Title: Crash when an asset doesn't exist (returns 404 response) · Issue #129 · josegonzalez/python-github-backup · GitHub
Open Graph Title: Crash when an asset doesn't exist (returns 404 response) · Issue #129 · josegonzalez/python-github-backup
X Title: Crash when an asset doesn't exist (returns 404 response) · Issue #129 · josegonzalez/python-github-backup
Description: I've just started using this tool to backup my Github account, including all starred repositories. I ran into an issue where somehow an asset link 404ed (not sure why that would happen as any asset should be available from Github). In th...
Open Graph Description: I've just started using this tool to backup my Github account, including all starred repositories. I ran into an issue where somehow an asset link 404ed (not sure why that would happen as any asset...
X Description: I've just started using this tool to backup my Github account, including all starred repositories. I ran into an issue where somehow an asset link 404ed (not sure why that would happen as any a...
Opengraph URL: https://github.com/josegonzalez/python-github-backup/issues/129
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crash when an asset doesn't exist (returns 404 response)","articleBody":"I've just started using this tool to backup my Github account, including all starred repositories. I ran into an issue where somehow an asset link 404ed (not sure why that would happen as any asset should be available from Github). In this case, the script crashed on `urllib.error.HTTPError: HTTP Error 404: Not Found` and could not continue.\r\n\r\n404 responses on assets should probably be handled the same way a 404 is handled on a repo, e.g. it should print that it's skipping that asset and continue.\r\n\r\nFor reference, here is the output:\r\n\r\n```\r\nCloning reicast-emulator repository from https://*****:x-oauth-basic@github.com/reicast/reicast-emulator.git to /Users/bbaron/tmp/github-backup/starred/reicast/reicast-emulator/repository\r\nRetrieving reicast/reicast-emulator issues\r\nRequesting https://api.github.com/repos/reicast/reicast-emulator/issues?per_page=100&page=1&filter=all&state=open&since=2020-01-03T22%3A21%3A33Z\r\nRequesting https://api.github.com/repos/reicast/reicast-emulator/issues?per_page=100&page=1&filter=all&state=closed&since=2020-01-03T22%3A21%3A33Z\r\nSaving 0 issues to disk\r\nRetrieving reicast/reicast-emulator pull requests\r\nRequesting https://api.github.com/repos/reicast/reicast-emulator/pulls?per_page=100&page=1&filter=all&state=open&sort=updated&direction=desc\r\nRequesting https://api.github.com/repos/reicast/reicast-emulator/pulls?per_page=100&page=1&filter=all&state=closed&sort=updated&direction=desc\r\nSaving 0 pull requests to disk\r\nRetrieving reicast/reicast-emulator milestones\r\nRequesting https://api.github.com/repos/reicast/reicast-emulator/milestones?per_page=100&page=1&state=all\r\nSaving 9 milestones to disk\r\nRetrieving einsteinx2 labels\r\nRequesting https://api.github.com/repos/reicast/reicast-emulator/labels?per_page=100&page=1\r\nWriting 64 labels to disk\r\nRetrieving reicast/reicast-emulator releases\r\nRequesting https://api.github.com/repos/reicast/reicast-emulator/releases?per_page=100&page=1\r\nSaving 7 releases to disk\r\nRequesting https://api.github.com/repos/reicast/reicast-emulator/releases/18970705/assets?per_page=100&page=1\r\nRequesting https://api.github.com/repos/reicast/reicast-emulator/releases/18607180/assets?per_page=100&page=1\r\nRequesting https://api.github.com/repos/reicast/reicast-emulator/releases/18598619/assets?per_page=100&page=1\r\nRequesting https://api.github.com/repos/reicast/reicast-emulator/releases/12856493/assets?per_page=100&page=1\r\nTraceback (most recent call last):\r\n File \"/Users/bbaron/.platformio/penv/bin/github-backup\", line 1117, in \u003cmodule>\r\n main()\r\n File \"/Users/bbaron/.platformio/penv/bin/github-backup\", line 1112, in main\r\n backup_repositories(args, output_directory, repositories)\r\n File \"/Users/bbaron/.platformio/penv/bin/github-backup\", line 752, in backup_repositories\r\n include_assets=args.include_assets or args.include_everything)\r\n File \"/Users/bbaron/.platformio/penv/bin/github-backup\", line 962, in backup_releases\r\n download_file(asset['url'], os.path.join(release_cwd, asset['name']), get_auth(args))\r\n File \"/Users/bbaron/.platformio/penv/bin/github-backup\", line 572, in download_file\r\n response = opener.open(request)\r\n File \"/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py\", line 531, in open\r\n response = meth(req, response)\r\n File \"/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py\", line 641, in http_response\r\n 'http', request, response, code, msg, hdrs)\r\n File \"/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py\", line 563, in error\r\n result = self._call_chain(*args)\r\n File \"/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py\", line 503, in _call_chain\r\n result = func(*args)\r\n File \"/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py\", line 755, in http_error_302\r\n return self.parent.open(new, timeout=req.timeout)\r\n File \"/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py\", line 531, in open\r\n response = meth(req, response)\r\n File \"/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py\", line 641, in http_response\r\n 'http', request, response, code, msg, hdrs)\r\n File \"/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py\", line 569, in error\r\n return self._call_chain(*args)\r\n File \"/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py\", line 503, in _call_chain\r\n result = func(*args)\r\n File \"/usr/local/Cellar/python/3.7.5/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py\", line 649, in http_error_default\r\n raise HTTPError(req.full_url, code, msg, hdrs, fp)\r\nurllib.error.HTTPError: HTTP Error 404: Not Found\r\n```\r\n\r\nI'm working on fixing this now and will submit a PR when I'm done. I'm new to Python, so it will probably take me a little while to figure out how to handle it properly.","author":{"url":"https://github.com/einsteinx2","@type":"Person","name":"einsteinx2"},"datePublished":"2020-01-06T14:49:38Z","url":"https://github.com/josegonzalez/python-github-backup/issues/129"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e70c2214-9bce-9c86-9719-3730df06fa31 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B3E0:4C12B:5683AF:75E4CC:6B05E3AA |
| html-safe-nonce | 0e049d4a548b46a3e17900bc403b3215e5bb39c112bc0f35c68a3d3854af92b3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCM0UwOjRDMTJCOjU2ODNBRjo3NUU0Q0M6NkIwNUUzQUEiLCJ2aXNpdG9yX2lkIjoiNDMzODE0ODI2NzYyOTMzOTU2MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 474026dda76f14d4b075dd324775f51f9f079fdc70960b796c29776ffbfe9d63 |
| hovercard-subject-tag | issue:545765466 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/josegonzalez/python-github-backup/129/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6574026cf5a751e39047e3a16cf50c24bf55e9d9a0f336b4485594871ad92e4b/josegonzalez/python-github-backup/issues/129 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6574026cf5a751e39047e3a16cf50c24bf55e9d9a0f336b4485594871ad92e4b/josegonzalez/python-github-backup/issues/129 |
| og:image:alt | I've just started using this tool to backup my Github account, including all starred repositories. I ran into an issue where somehow an asset link 404ed (not sure why that would happen as any asset... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | einsteinx2 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9e6b0e6e5a9a8e0ddb968297ede4e2eac72d30ea174a0970eb8f22d6958e91e3 |
| turbo-cache-control | no-preview |
| go-import | github.com/josegonzalez/python-github-backup git https://github.com/josegonzalez/python-github-backup.git |
| octolytics-dimension-user_id | 65675 |
| octolytics-dimension-user_login | josegonzalez |
| octolytics-dimension-repository_id | 14876085 |
| octolytics-dimension-repository_nwo | josegonzalez/python-github-backup |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 14876085 |
| octolytics-dimension-repository_network_root_nwo | josegonzalez/python-github-backup |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 023691d14ad20c90d3ee61b0a0977b17dc6b6361 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width