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

canvasapi.exceptions.ResourceDoesNotExist: Not Found #2

Open
bigtendons8 opened this issue Aug 11, 2024 · 2 comments
Open

canvasapi.exceptions.ResourceDoesNotExist: Not Found #2

bigtendons8 opened this issue Aug 11, 2024 · 2 comments

Comments

@bigtendons8
Copy link

bigtendons8 commented Aug 11, 2024

Received this error when running.

file.download(path + sanitize_filename(file.filename))
  File "/usr/local/lib/python3.12/site-packages/canvasapi/file.py", line 30, in download
    response = self._requester.request("GET", _url=self.url)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/canvasapi/requester.py", line 255, in request
    raise ResourceDoesNotExist("Not Found")
canvasapi.exceptions.ResourceDoesNotExist: Not Found

Running with Docker.

I understand this might not be being actively developed but I think it is quite a useful application

@eric8he
Copy link

eric8he commented Nov 7, 2024

What command did you run to get this error?

The URL param should just be the home/root of your org's Canvas page.

Ex.
https://canvas.YOURINSTITUTION.edu/

I got the error when I tried to put in my course ID in the URL.

@john-hix
Copy link
Owner

john-hix commented Nov 16, 2024

Hi, there. @bigtendons8 is right, this isn't a project I actively maintain. I can't even say I'll be able to respond more than this single message.

As a user, I would try constraining which courses you attempt to download would help you do a process of elimination to find out if it's a particular course that is causing the not found error. You can specify which courses to download by getting their course ID(s) from their Canvas URLs, then passing the IDs as a comma-separated list, as the README indicates.

The approach above isn't at all ideal, since your instructor(s) would have had to keep working links for everything in the course, and who does that?

As a developer, I would go for the root cause, which seems to be incomplete handling of the ResourceDoesNotExist error (it's done in a few places in the script, and - if I recall correctly - I wasn't happy with how it was done when I wrote it that way. If someone wants to open a PR that improves how those errors are handled, I'd merge it, all else being equal.

[EDIT] Specifically, we need to know why the ResourceDoesNotExist error is not getting caught. @bigtendons8 may be able to provide additional context to whomever might try to track down why the error is not caught properly.

Thanks for reports, @eric8he and @bigtendons8 .

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

3 participants