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

Stuck Getting courses from Canvas #1

Open
Mibo5354 opened this issue Mar 5, 2019 · 13 comments
Open

Stuck Getting courses from Canvas #1

Mibo5354 opened this issue Mar 5, 2019 · 13 comments

Comments

@Mibo5354
Copy link

Mibo5354 commented Mar 5, 2019

After the initial log on, it gets stuck on the "Getting courses from Canvas" page. The access token is successfully created and the usage is recorded. Is there a debug log available somewhere?
Edit: After looking through the log, it's just infinitely looping through parsing the courses.

@drew-royster
Copy link
Owner

I have yet to see that bug. Is there anything that stood out in the logs?

If you want to help me look into this, try hitting the some of the apis in my repo here https://github.com/drew-royster/canvasAPISPostman

Those are the apis I'm hitting for Canvas File Sync to work.

to debug I'd

  1. see if it lists the right active courses
  2. see if you can list all your folders
  3. see if you can list all your files

Interested to see what you find.

Sorry about the issue and thanks for the feedback!

@Mibo5354
Copy link
Author

Mibo5354 commented Apr 30, 2019

  1. It lists all the right active courses
  2. GetAllFolders throws an error
{
    "errors": [
        {
            "message": "The specified resource does not exist."
        }
    ]
}

A lot of the GET commands throws the same error.

https://gist.github.com/Mibo5354/44a5735ac74a95d83425246b286c9e9b
Looking at these logs there's just a lot of 404 errors.
Would the page https://{rootURL}/courses/{course_id}/files being disabled cause the 404s?

@lucassz
Copy link

lucassz commented Apr 30, 2019

I've been having this issue as well, and am happy to provide diagnostic info via Postman. However, it seems that I need to specify an authToken -- is it possible to get this from any kind of logs left by CFS, or is there a direct way to obtain it?

@Mibo5354
Copy link
Author

Mibo5354 commented Apr 30, 2019

@lucassz You can get the authToken from canvas in the account settings.
It's under "Approved integrations", there you can generate an access token.

@drew-royster
Copy link
Owner

  1. It lists all the right active courses
  2. GetAllFolders throws an error
{
    "errors": [
        {
            "message": "The specified resource does not exist."
        }
    ]
}

A lot of the GET commands throws the same error.

gist.github.com/Mibo5354/44a5735ac74a95d83425246b286c9e9b
Looking at these logs there's just a lot of 404 errors.
Would the page https://{rootURL}/courses/{course_id}/files being disabled cause the 404s?

Can you get to the files through the UI?

I'm not doing anything sneaky so if you can't get to the files from the UI, then the app probably can't find them either.

I'm getting files from the modules view as well so maybe I just need to make it handle a disabled /files api gracefully without crashing the whole program?

I have a test course that I can enable or disable things on. Let me try disabling /folders and /files to see how it handles it on my end.

@Mibo5354
Copy link
Author

Mibo5354 commented Apr 30, 2019

I can get to the files through the UI where everything is attached in modules. There are extra files within the module pages embedded as links and videos.

@Mibo5354
Copy link
Author

Mibo5354 commented Apr 30, 2019

image
These are all the entries that I have for a module, as you can see files is missing.
image
This is how the files are attached; look at the PDFs and the .mov
In the page like the first entry, there are more files attached as links.
image

There are pages and files in the module that are time locked and I'm not sure if your program can gracefully handle that since a python script I tried out before crashes due to this.

@drew-royster
Copy link
Owner

drew-royster commented May 1, 2019

v1.5.1 should fix this issue!

Please let me know if this works for you.

I am now filtering out files that are marked as locked_for_user. None of the classes I had tested previously had time locked files so I'm glad you helped me find and work through this issue.

@Mibo5354
Copy link
Author

Mibo5354 commented May 2, 2019

It downloads all the files attached directly in the modules section but it doesn't download the files attached inline within the separate pages in modules.

@drew-royster
Copy link
Owner

Okay so the idea would be that I check module pages scan for links and download any that are url's which contain any type of file extension?

I think that your situation isn't completely unique, but have also had some teachers post google drive links, github, etc so it's not just simply downloading any link.

Maybe I just download any url's with a . in the last section of the url because that would denote that it's a file?

Figuring out if updates happen to that link would be much harder, because at that point we are outside of the Canvas framework.

@Mibo5354
Copy link
Author

Mibo5354 commented May 2, 2019

It's still linking to files on canvas. For example, https://myuni.adelaide.edu.au/courses/44344/files/4211757/download?wrap=1

@lucassz
Copy link

lucassz commented May 10, 2019

I used to have the initial issue where it would just get stuck getting courses from Canvas. On version 1.5.1, I get to this stage:
CFS Issue
where I blacked out the (correct) course names. Not sure what's up with the ones that don't show up, and if I click on the button to enable it, nothing happens. Strangely, the 3 that do work aren't the most recent or any other logical pattern (and of course, the others do have accessible files). I'm able to enable/disable the 3 that do show up, and can successfully sync from them.

@lucassz
Copy link

lucassz commented May 13, 2019

Now one more course has showed up with its name and being syncable, for no apparent reason! Also, I'll point out that I have way more than 8 courses visible on Canvas, so not all are showing up even in that glitched form.

@drew-royster

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