images/files broken

194 views
Skip to first unread message

Frank Vazquez

unread,
Aug 25, 2015, 4:04:05 PM8/25/15
to Canvas LMS Users
Just finished setting up a production instance and everything seems to work except images and files, all show as broken links in the browser.

I made sure that canvasuser and www-data have appropriate permissions with the following:

~/var/canvas$ sudo chown -R canvasuser:canvasuser ./public
~/var/canvas$ sudo usermod -a -G canvasuser www-data


I'm not sure how the images are called, but this new production instance is a VM replacing a physical box.  the physical box is still live with the same hostname.  I'm browsing to this new instance through IP address, but the apache config and everything is setup with the shared (for now) hostname.  Could it be that the browser is calling on my physical instance for the images/files and since they dont exist there, nothing is pulling up?  When i look at the source of this page, the link is showing the IP address rather than my hostname, but the path listed (/courses/1/files/3/preview) doesn't exist under /public (since this is listed as the documentroot).

thanks!

Frank Vazquez

unread,
Aug 25, 2015, 4:22:14 PM8/25/15
to Canvas LMS Users
So i took the old server down and statically set the IP address on the new so DNS would work, still no change, images/links are broken.

Any ideas on where I can look?

Frank Vazquez

unread,
Aug 25, 2015, 4:44:00 PM8/25/15
to Canvas LMS Users
also, since i figured it wouldnt hurt, i did this to make sure permissions were ok on /tmp
~/var/canvas$ sudo chown -R canvasuser:canvasuser ./tmp/

no change.
when trying to navigate to the image or thumbnail directly either by browsing through files or URL manipulation, i cannot load either image.

Frank Vazquez

unread,
Aug 25, 2015, 5:24:18 PM8/25/15
to Canvas LMS Users
found some logs, maybe this will help

~$ psql canvas_production -c "select message, backtrace from error_reports order by id desc limit 1;"
                                                  message                                                   |                                                            backtrace                                                            
------------------------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------------------------------------------------------
 Permission denied @ rb_sysopen - /tmp/attachment_fu/20150825-10403-n4e3702959256431440525094_858__ugly.jpg | /usr/lib/ruby/2.1.0/tempfile.rb:146:in `initialize'                                                                            +
                                                                                                            | /usr/lib/ruby/2.1.0/tempfile.rb:146:in `open'                                                                                  +
                                                                                                            | /usr/lib/ruby/2.1.0/tempfile.rb:146:in `block in initialize'                                                                   +
                                                                                                            | /usr/lib/ruby/2.1.0/tmpdir.rb:142:in `create'                                                                                  +
                                                                                                            | /usr/lib/ruby/2.1.0/tempfile.rb:136:in `initialize'                                                                            +
                                                                                                            | /var/canvas/gems/attachment_fu/lib/attachment_fu.rb:216:in `new'                                                               +
                                                                                                            | /var/canvas/gems/attachment_fu/lib/attachment_fu.rb:216:in `copy_to_temp_file'                                                 +
                                                                                                            | /var/canvas/gems/attachment_fu/lib/attachment_fu.rb:460:in `copy_to_temp_file'                                                 +
                                                                                                            | /var/canvas/gems/attachment_fu/lib/attachment_fu/backends/file_system_backend.rb:69:in `create_temp_file'                      +
                                                                                                            | /var/canvas/gems/attachment_fu/lib/attachment_fu.rb:283:in `create_thumbnail_size'                                             +
                                                                                                            | /var/canvas/vendor/bundle/ruby/2.1.0/gems/canvas-jobs-0.9.13/lib/delayed/performable_method.rb:21:in `perform'                 +
                                                                                                            | /var/canvas/vendor/bundle/ruby/2.1.0/gems/canvas-jobs-0.9.13/lib/delayed/backend/base.rb:225:in `block in invoke_job'          +
                                                                                                            | /var/canvas/vendor/bundle/ruby/2.1.0/gems/canvas-jobs-0.9.13/lib/delayed/lifecycle.rb:63:in `call'                             +
                                                                                                            | /var/canvas/vendor/bundle/ruby/2.1.0/gems/canvas-jobs-0.9.13/lib/delayed/lifecycle.rb:63:in `block in initialize'              +
                                                                                                            | /var/canvas/vendor/bundle/ruby/2.1.0/gems/canvas-jobs-0.9.13/lib/delayed/lifecycle.rb:68:in `call'                             +
                                                                                                            | /var/canvas/vendor/bundle/ruby/2.1.0/gems/canvas-jobs-0.9.13/lib/delayed/lifecycle.rb:68:in `execute'                          +
                                                                                                            | /var/canvas/vendor/bundle/ruby/2.1.0/gems/canvas-jobs-0.9.13/lib/delayed/lifecycle.rb:41:in `run_callbacks'                    +
                                                                                                            | /var/canvas/vendor/bundle/ruby/2.1.0/gems/canvas-jobs-0.9.13/lib/delayed/backend/base.rb:222:in `invoke_job'                   +
                                                                                                            | /var/canvas/vendor/bundle/ruby/2.1.0/gems/canvas-jobs-0.9.13/lib/delayed/worker.rb:142:in `block (2 levels) in perform'        +

On Tuesday, August 25, 2015 at 4:04:05 PM UTC-4, Frank Vazquez wrote:

Frank Vazquez

unread,
Aug 25, 2015, 7:16:55 PM8/25/15
to Canvas LMS Users
Another interesting note, when i go to the files page within the course i uploaded images, I can see the thumbnails.  They call on a URL which exists in /var/canvas/public/images/thumbnails/ however, no such directory really exists under images.

Why is the tmp directory outside of the documentroot?  (/var/canvas/tmp instead of /var/canvas/public/tmp)

Frank Vazquez

unread,
Aug 25, 2015, 7:30:21 PM8/25/15
to Canvas LMS Users
Attaching a file with my pqsl error output for the last 100.  getting a different error now.

PG::UniqueViolation: ERROR:  duplicate key value violates unique constraint "index_thumbnails_size"


postgresoutput.txt

Frank Vazquez

unread,
Aug 28, 2015, 2:15:45 AM8/28/15
to Canvas LMS Users
I am fantastically stupid.  I set the A record for canvasinstance.com to the appropriate IP address, but forgot to set the A record for my canvasfiles subdomain (which in my instance is canvasfiles.canvasinstance.com)

So, if anyone else runs across this in the future, make sure to check and make sure the A record on your ServerAlias (defined in your apache conf) is pointed to the right IP.

I wasted almost a solid week on this and have torn down and stood up canvas (5) times.  Got a lot of great troubleshooting steps documented out of it I guess...

On Tuesday, August 25, 2015 at 4:04:05 PM UTC-4, Frank Vazquez wrote:

Becky Kinney

unread,
Aug 28, 2015, 7:42:54 AM8/28/15
to canvas-l...@googlegroups.com
Don't think of yourself as fantastically stupid, but rather as fantastically tenacious. You stuck with it through a miserable, grueling week, and now it's fixed. Maybe you even have some hair left in your head. Good for you.

Becky Kinney
Academic Technology Services

--

---
You received this message because you are subscribed to the Google Groups "Canvas LMS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to canvas-lms-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages