Staging instance, all changes can be removed at any time

Skip to content

cvsclient: Fix pserver error: "protocol error: <path> is not absolute"

Some CVS servers (SourceForge and OSDN for instance) return an error if the path sent with the "Directory" pserver request is not absolute.

So fix that issue to ensure loading of such CVS repositories.

Before that change:

(swh) anlambert@carnavalet:/tmp/cvs_test$ swh loader -C ~/.config/swh/loader/cvs.yml run cvs pserver://anonymous@a.cvs.sourceforge.net/cvsroot/yazoo/help
INFO:swh.loader.cvs.loader.CvsLoader:Load origin 'pserver://anonymous@a.cvs.sourceforge.net/cvsroot/yazoo/help' with type 'cvs'
ERROR:swh.loader.cvs.loader.CvsLoader:Exception in fetch_data:
Traceback (most recent call last):
  File "/home/anlambert/swh/swh-environment/swh-loader-cvs/swh/loader/cvs/loader.py", line 555, in fetch_data
    data = next(self.swh_revision_gen)
  File "/home/anlambert/swh/swh-environment/swh-loader-cvs/swh/loader/cvs/loader.py", line 278, in process_cvs_changesets
    self.checkout_file_with_cvsclient(k, f, self.cvsclient)
  File "/home/anlambert/swh/swh-environment/swh-loader-cvs/swh/loader/cvs/loader.py", line 232, in checkout_file_with_cvsclient
    fp = cvsclient.checkout(path, f.rev, dirname, expand_keywords=True)
  File "/home/anlambert/swh/swh-environment/swh-loader-cvs/swh/loader/cvs/cvsclient.py", line 387, in checkout
    raise CVSProtocolError("Error from CVS server: %s" % response)
swh.loader.cvs.cvsclient.CVSProtocolError: Error from CVS server: b'E protocol error: help is not absolute\n'
{'status': 'failed'} for origin 'pserver://anonymous@a.cvs.sourceforge.net/cvsroot/yazoo/help'


(swh) anlambert@carnavalet:/tmp/cvs_test$ swh loader -C ~/.config/swh/loader/cvs.yml run cvs pserver://anonymous@cvs.osdn.net/cvsroot/phpgwjp/wiki
INFO:swh.loader.cvs.loader.CvsLoader:Load origin 'pserver://anonymous@cvs.osdn.net/cvsroot/phpgwjp/wiki' with type 'cvs'
ERROR:swh.loader.cvs.loader.CvsLoader:Exception in fetch_data:
Traceback (most recent call last):
  File "/home/anlambert/swh/swh-environment/swh-loader-cvs/swh/loader/cvs/loader.py", line 555, in fetch_data
    data = next(self.swh_revision_gen)
  File "/home/anlambert/swh/swh-environment/swh-loader-cvs/swh/loader/cvs/loader.py", line 278, in process_cvs_changesets
    self.checkout_file_with_cvsclient(k, f, self.cvsclient)
  File "/home/anlambert/swh/swh-environment/swh-loader-cvs/swh/loader/cvs/loader.py", line 232, in checkout_file_with_cvsclient
    fp = cvsclient.checkout(path, f.rev, dirname, expand_keywords=True)
  File "/home/anlambert/swh/swh-environment/swh-loader-cvs/swh/loader/cvs/cvsclient.py", line 387, in checkout
    raise CVSProtocolError("Error from CVS server: %s" % response)
swh.loader.cvs.cvsclient.CVSProtocolError: Error from CVS server: b'E protocol error: wiki is not absolute\n'
{'status': 'failed'} for origin 'pserver://anonymous@cvs.osdn.net/cvsroot/phpgwjp/wiki'

After that change:

(swh) anlambert@carnavalet:/tmp/cvs_test$ swh loader -C ~/.config/swh/loader/cvs.yml run cvs pserver://anonymous@a.cvs.sourceforge.net/cvsroot/yazoo/help
INFO:swh.loader.cvs.loader.CvsLoader:Load origin 'pserver://anonymous@a.cvs.sourceforge.net/cvsroot/yazoo/help' with type 'cvs'

{'status': 'eventful'} for origin 'pserver://anonymous@a.cvs.sourceforge.net/cvsroot/yazoo/help'


(swh) anlambert@carnavalet:/tmp/cvs_test$ swh loader -C ~/.config/swh/loader/cvs.yml run cvs pserver://anonymous@cvs.osdn.net/cvsroot/phpgwjp/wiki
INFO:swh.loader.cvs.loader.CvsLoader:Load origin 'pserver://anonymous@cvs.osdn.net/cvsroot/phpgwjp/wiki' with type 'cvs'

{'status': 'eventful'} for origin 'pserver://anonymous@cvs.osdn.net/cvsroot/phpgwjp/wiki'

Test Plan

This looks related to the CVS server version used, I do not have an easy way to reproduce the issue in a test.


Migrated from D8005 (view on Phabricator)

Merge request reports

Loading