Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution of Quickstart Tutorial fails because of missing 2.root.json #1002

Closed
Silvanoc opened this issue Mar 16, 2020 · 2 comments
Closed

Comments

@Silvanoc
Copy link

Description of issue or feature request:

Execution of the "Quickstart Tutorial" fails (with Tag v0.12.2 and current develop HEAD c63b7f3). It reports that the file 2.root.json cannot be found.

Current behavior:

Execution of the "Quickstart Tutorial" fails (with Tag v0.12.2 and current develop HEAD c63b7f3) with following message:

Could not download URL: 'http://localhost:8001/metadata/2.root.json'
Traceback (most recent call last):
  File "/path/to/tuf/download.py", line 264, in _download_file
    response.raise_for_status()
  File "/usr/lib/python3/dist-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: File not found for url: http://localhost:8001/metadata/2.root.json
Update failed from http://localhost:8001/metadata/2.root.json.
Traceback (most recent call last):
  File "/path/to/tuf/client/updater.py", line 1507, in _get_metadata_file
    upperbound_filelength)
  File "/path/to/tuf/download.py", line 150, in unsafe_download
    return _download_file(url, required_length, STRICT_REQUIRED_LENGTH=False)
  File "/path/to/tuf/download.py", line 264, in _download_file
    response.raise_for_status()
  File "/usr/lib/python3/dist-packages/requests/models.py", line 940, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: File not found for url: http://localhost:8001/metadata/2.root.json
Failed to update '2.root.json' from all mirrors: {'http://localhost:8001/metadata/2.root.json': HTTPError('404 Client Error: File not found for url: http://localhost:8001/metadata/2.root.json')}
ERROR:root:HTTP error for root version 2
Traceback (most recent call last):
  File "/path/to/tuf/client/updater.py", line 1150, in _update_root_metadata
    version=next_version)
  File "/path/to/tuf/client/updater.py", line 1786, in _update_metadata
    upperbound_filelength, version)
  File "/path/to/tuf/client/updater.py", line 1602, in _get_metadata_file
    raise tuf.exceptions.NoWorkingMirrorError(file_mirror_errors)
tuf.exceptions.NoWorkingMirrorError: No working mirror was found:
  'localhost:8001': HTTPError('404 Client Error: File not found for url: http://localhost:8001/metadata/2.root.json')
INFO:tuf.download:Downloading: 'http://localhost:8001/metadata/timestamp.json'
INFO:tuf.download:Downloaded 557 bytes out of an upper limit of 16384 bytes.
INFO:tuf.download:Downloading: 'http://localhost:8001/metadata/snapshot.json'
INFO:tuf.download:Downloaded 472 bytes out of an upper limit of 2000000 bytes.
INFO:tuf.download:Downloading: 'http://localhost:8001/metadata/targets.json'
INFO:tuf.download:Downloaded 735 bytes out of an upper limit of 5000000 bytes.
INFO:tuf.client.updater:'targets.json' up-to-date.
INFO:tuf.client.updater:'targets.json' up-to-date.
INFO:tuf.download:Downloading: 'http://localhost:8001/targets/testfile'
INFO:tuf.download:Downloaded 10 bytes out of the expected 10 bytes.
INFO:tuf.client.updater:The file's sha256 hash is correct: 114811b0b8998cb9853a5379598021410feddf69bb2ee7b7145d052a7e9b5d45
INFO:tuf.client.updater:The file's sha512 hash is correct: 9484ec641bd36078436a993000045bbc380f77d8897e9dcc1b784c10642abe31f5469b9b6c31afa3a286abb4d0ce618468043883bce231c99aa984ea9ff14a64

Expected behavior:

The Quickstart Tutorial works without errors.

@joshuagl
Copy link
Member

Thanks for the report @Silvanoc. This is a known issue (see #983) where the logging in TUF is reporting errors despite things proceeding as expected.

You can see from the last four lines of INFO output that the file was downloaded and verified as matching the hashes in the targets metadata:

INFO:tuf.download:Downloading: 'http://localhost:8001/targets/testfile'
INFO:tuf.download:Downloaded 10 bytes out of the expected 10 bytes.
INFO:tuf.client.updater:The file's sha256 hash is correct: 114811b0b8998cb9853a5379598021410feddf69bb2ee7b7145d052a7e9b5d45
INFO:tuf.client.updater:The file's sha512 hash is correct: 9484ec641bd36078436a993000045bbc380f77d8897e9dcc1b784c10642abe31f5469b9b6c31afa3a286abb4d0ce618468043883bce231c99aa984ea9ff14a64

@Silvanoc
Copy link
Author

Ups, sorry for the duplicate. Closing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants