question
How do I add URLs that require authentication to the repository using datalad addurls?
I am trying to add a specific URL to the repository using the “datalad addurls” command.
However, it does not work and I get an error.
The error message includes “unable to access url”.
The URL given to “datalad addurls” requires authentication, so I gave the following URL (example)
URL = http://username:password@domain.com/file/to/path/test_data.txt
In fact, we get the values for “datalad addurls” in a CSV file.
CSV file.
who,link
to/path/test_data.txt,http://username:password@domain.com/file/to/path/test_data.txt
Commands executed
datalad addurls --nosave --fast .tmp/datalad-addurls.csv ‘{link}’ ‘{who}’
Additional Information
Running “http://username:password@domain.com/file/to/path/test_data.txt” in a browser or Postman confirmed that we could get data.
I have looked into how to mound “datalad addurls” when dealing with URLs that require authentication, but have not found a good solution.
Version in my env
- datalad 0.17.6
- Ubuntu 20.04.4 LTS
Full Error
$ datalad addurls --nosave --fast .tmp/datalad-addurls.csv '{link}' '{who}'
["addurls(error): /home/jovyan/to/path/test_data.txt (file)
[AnnexBatchCommandError(AnnexBatchCommandError: 'addurl'
[Error, annex reported failure for addurl (url='http://username:password@domain.com/file/to/path/test_data.txt'):
{'command': 'addurl', 'success': False, 'input': ['http://username:password@domain.com/file/to/path/test_data.txt to/path/test_data.txt'], 'error-messages': [' unable to access url: http://username:password@domain.com/file/to/path/test_data.txt'], 'file': 'to/path/test_data.txt'}])] [AnnexBatchCommandError: 'addurl' [Error, annex reported failure for addurl (url='http://username:password@domain.com/file/to/path/test_data.txt'): {'command': 'addurl', 'success': False, 'input': ['http://username:password@domain.com/file/to/path/test_data.txt'], 'error-messages': [' unable to access url: http://username:password@domain.com/file/to/path/test_data.txt'], 'file': 'to/path/test_data.txt'}]]", "[ERROR] BatchedAnnex(command=['git', '-c', 'diff.ignoreSubmodules=none', 'annex', 'addurl', '--fast', '--with-files', '--json', '--json-error-messages', '--batch'], encoding=UTF-8, exception_on_timeout=False, generator=<datalad.runner.nonasyncrunner._ResultGenerator object at 0x7fa40c583a00>, output_proc=<function readline_json at 0x7fa40ce911f0>, path=/home/jovyan, return_code=None, runner=<datalad.runner.runner.WitlessRunner object at 0x7fa40c580ac0>, stderr_output=b'addurl: 1 failed\\n', stdin_queue=<queue.Queue object at 0x7fa40c5c7df0>, timeout=None, wait_timed_out=None) subprocess failed with CommandError: 'git -c diff.ignoreSubmodules=none annex addurl --fast --with-files --json --json-error-messages --batch' failed with exitcode 1 ", 'action summary:', ' addurls (error: 1)']