Javascript 404 errors for unusual URL routes when editing pages cause Loading Failed messages
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Self-hosted installation. When editing a page, we see some 404 errors in the javascript console trying to load the following urls:
https://canvas.example.edu/api/session
https://canvas.example.edu/api/folders?contextType=course&contextId=77
Not sure what the first one is for, but the second message means the "Files" tab along the right side is disabled. There are a couple other javascript errors as well, but they come after this and I believe are simply the result of missing these other script objects.
Looking further at that area on the right, in the "Links" tab, we get additional 404 errors in the javascript console if we expand any of the sections, resulting in a "Loading Failed" message. For example, expanding the "Discussions" section inside the Links area produces a 404 error in the javascript console for this address:
https://canvas.example.edu/api/discussions?contextType=course&contextId=77
And we see this on the page:
77 is the correct course id, and the same thing happens for all of our courses.
This is related to these other questions, which have incomplete or no solutions posted:
https://community.canvaslms.com/thread/19398-how-do-i-fix-a-loading-failed-message
https://community.canvaslms.com/thread/15417-edit-page-loading-failedno-resultsHow do I fix a Loading Failed Message?
I'm not surprised these URLs produce 404 errors, since they don't match anything in config/routes.rb... but where are they coming from? How can I fix it? What could be going on here?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Was able to fix that.
1. It requires RCE API server to be up and running https://github.com/instructure/canvas-rce-api
2. It should be accessible from the outside:
- I used Docker variant, and run in it on port 3333
- I used same domain as Canvas itself with addition of "/rce/" path. In config/dynamic_setting.yml:
rich-content-service:
app-host: "mycanvasdomain.com/rce"
- Make sure that dynamic_setting.yml starts with the right environment. It was "development:" for me, I had to change it to "production:"
- In Apache2 config I added proxy rewrite for "/rce/" path:
RewriteEngine on RewriteRule "^/rce/(.*)$" "http://localhost:3333/$1" [P] ProxyPassReverse "/rce/" "http://localhost:3333/"
3. After Apache2 restart, browser now used correct "/rce/api/session" requests which was forwarded to RCE api server.