autolab / Autolab

Course management service that enables auto-graded programming assignments.
http://www.autolabproject.com/
Apache License 2.0
752 stars 214 forks source link

Adding attachment to assessment fails #123

Closed ymzong closed 9 years ago

ymzong commented 9 years ago

I tried to add a PDF to an already-released homework assignment. I went to "Manage Assessment Attachements" --> Add hw1 Attachment --> attached the PDF, then I got a 500 error with the following error message and stack trace:

--- !ruby/exception:Errno::ENOENT
message: No such file or directory @ rb_sysopen - /opt/autolab/build/Autolab/attachments/hw1.pdf
/opt/autolab/build/Autolab/app/models/attachment.rb:25:in `initialize'
/opt/autolab/build/Autolab/app/models/attachment.rb:25:in `open'
/opt/autolab/build/Autolab/app/models/attachment.rb:25:in `file='
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/attribute_assignment.rb:54:in `public_send'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/attribute_assignment.rb:54:in `_assign_attribute'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/attribute_assignment.rb:41:in `block in assign_attributes'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal/strong_parameters.rb:183:in `each_pair'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal/strong_parameters.rb:183:in `each_pair'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/attribute_assignment.rb:35:in `assign_attributes'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/persistence.rb:249:in `block in update'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/transactions.rb:347:in `block in with_transaction_returning_status'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `block in transaction'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/transaction.rb:188:in `within_new_transaction'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:213:in `transaction'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/transactions.rb:220:in `transaction'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/transactions.rb:344:in `with_transaction_returning_status'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/persistence.rb:248:in `update'
/opt/autolab/build/Autolab/app/controllers/attachments_controller.rb:23:in `create'
...
dlbucci commented 9 years ago

This was a CMU-specific issue. I created the directory and we should be fine.