Bug #5522
vcsserver fails when url contains extra "/"
0%
Description
We use bitbake to build software for our products. Bitbake fetches the latest sourcecode from various repositories before it start to build software.
Bitbake uses a receipes which tell bitbake what repository to use and how to build the url to access that repository.
Part of a receipe below:
HGNAME = "repogroup/reponame" SRC_URI = "hg://kvmech.kvernelandgroup.com/rhodecode/;protocol=http;scmdata=keep;module=${HGNAME}"
This would work with our previous rhodecode version (4.12.4)
Last week I updated to rhodecode 4.15 and the fetching of repositories did not work anymore. Bitbake reported:
ERROR: Fetcher failure: Fetch command failed with exit code 255, output: abort: HTTP Error 500: Internal Server Error ERROR: Function failed: Fetcher failure for URL: 'hg://kvmech.kvernelandgroup.com/rhodecode/;protocol=http;scmdata=keep;module=repogroup/reponame'. Unable to fetch URL from any source.
The following error is from the vcssserver.log:
2018-12-23 12:37:49.733 DEBUG [vcsserver.http_main] method called:localrepository with kwargs:{} context_uid: 7d80d0bf-d5c0-49a9-a104-3ef33f73fa5d 2018-12-23 12:37:49.733 DEBUG [dogpile.lock] NeedRegenerationException 2018-12-23 12:37:49.733 DEBUG [dogpile.lock] no value, waiting for create lock 2018-12-23 12:37:49.733 DEBUG [dogpile.lock] value creation lock <dogpile.cache.region._LockWrapper object at 0x7f3b1f84bc10> acquired 2018-12-23 12:37:49.734 DEBUG [dogpile.lock] Calling creation function for not-yet-present value 2018-12-23 12:37:49.736 DEBUG [dogpile.lock] Released creation lock 2018-12-23 12:37:49.736 INFO [vcsserver.tweens] IP: 127.0.0.1 Request to path: `/hg` time: 0.003s 2018-12-23 12:37:49.755 DEBUG [vcsserver.http_main] http-app: handling hg stream 2018-12-23 12:37:49.755 DEBUG [vcsserver.scm_app] Creating Mercurial WSGI application 2018-12-23 12:37:49.757 DEBUG [vcsserver.scm_app] hgrc file is not present at /repos/repogroup/reponame/.hg/hgrc, skipping... 2018-12-23 12:37:49.759 DEBUG [vcsserver.http_main] http-app: starting app handler with <vcsserver.scm_app.HgWeb object at 0x7f3b1cdd70d0> and process request 2018-12-23 12:37:49.790 DEBUG [vcsserver.lib.exc_tracking] Stored generated exception 139891865038592 as: /tmp/rc_exception_store_v1/139891865038592_vcsserver_1545565069.767842 2018-12-23 12:37:49.791 ERROR [vcsserver.http_main] error occurred handling this request for path: //repogroup/reponame, tb: Traceback (most recent call last): File "/opt/rhodecode/store/mcjhzq84p171b42cwjlszbz8611ir1b8-python2.7-pyramid-1.9.2/lib/python2.7/site-packages/pyramid/tweens.py", line 39, in excview_tween response = handler(request) File "/opt/rhodecode/store/mcjhzq84p171b42cwjlszbz8611ir1b8-python2.7-pyramid-1.9.2/lib/python2.7/site-packages/pyramid/router.py", line 156, in handle_request view_name File "/opt/rhodecode/store/mcjhzq84p171b42cwjlszbz8611ir1b8-python2.7-pyramid-1.9.2/lib/python2.7/site-packages/pyramid/view.py", line 642, in _call_view response = view_callable(context, request) File "/opt/rhodecode/store/mcjhzq84p171b42cwjlszbz8611ir1b8-python2.7-pyramid-1.9.2/lib/python2.7/site-packages/pyramid/viewderivers.py", line 410, in viewresult_to_response result = view(context, request) File "/opt/rhodecode/store/mcjhzq84p171b42cwjlszbz8611ir1b8-python2.7-pyramid-1.9.2/lib/python2.7/site-packages/pyramid/wsgi.py", line 37, in decorator return request.get_response(wrapped) File "/opt/rhodecode/store/rwjyfikqcf3lbm6gppji4q36fdh83dll-python2.7-webob-1.7.4/lib/python2.7/site-packages/webob/request.py", line 1327, in send application, catch_exc_info=False) File "/opt/rhodecode/store/rwjyfikqcf3lbm6gppji4q36fdh83dll-python2.7-webob-1.7.4/lib/python2.7/site-packages/webob/request.py", line 1291, in call_application app_iter = application(self.environ, start_response) File "/opt/rhodecode/store/hsq37yg96ril6xlifrvb030v290zbm6k-python2.7-rhodecode-vcsserver-4.15.0/lib/python2.7/site-packages/vcsserver/http_main.py", line 509, in _hg_stream return app(environ, ResponseFilter(start_response)) File "/opt/rhodecode/store/hsq37yg96ril6xlifrvb030v290zbm6k-python2.7-rhodecode-vcsserver-4.15.0/lib/python2.7/site-packages/vcsserver/scm_app.py", line 77, in __call__ req = requestmod.parserequestfromenv(environ) File "/opt/rhodecode/store/bhipby53csk71p07gsmi6q3p89qn6am3-python2.7-mercurial-4.6.2/lib/python2.7/site-packages/mercurial/hgweb/request.py", line 260, in parserequestfromenv reponame)) ProgrammingError: PATH_INFO does not begin with repo name: //repogroup/reponame (repogroup/reponame)
It seems like bitbake generates an url with an extra "/" > "//repogroup/reponame"
I removed the trailing "/" from the bitbake receipe and everythong worked fine again:
HGNAME = "repogroup/reponame" SRC_URI = "hg://kvmech.kvernelandgroup.com/rhodecode;protocol=http;scmdata=keep;module=${HGNAME}"
It looks like rhodecode became more strict with url formatting.
The problem is resolved with the change to the bitbake receipe but the behaviour of rhodecode definitely changed between 4.12 and 4.15.
And i think a 404 error would be more appropriate instead of a 500 server error.
Updated by Redmine Integration over 3 years ago
- Status changed from New to Resolved
Commit 44e97172e86f
by Marcin Kuzminski marcin@rhodecode.com on default
branch changed this issue.
https://code.rhodecode.com/rhodecode-enterprise-ce/changeset/44e97172e86f722b97d8f2f9448ef5133ad2c9ce
Commit e2c979bce842
by Marcin Kuzminski marcin@rhodecode.com on stable
branch changed this issue.
https://code.rhodecode.com/rhodecode-enterprise-ce/changeset/e2c979bce8420a56e1391d83800499bb7ec9f269