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

AFS Submit Script Broken #126

Closed
metalogical opened this issue Jan 18, 2015 · 53 comments
Closed

AFS Submit Script Broken #126

metalogical opened this issue Jan 18, 2015 · 53 comments
Assignees

Comments

@metalogical
Copy link

The example script given (Autolab/script/autolabSubmit.sh) is broken. In particular, it seems that the unofficial.fish.ics.cs.cmu.edu URL can't see "new Autolab" courses and gives me ERROR: invalid course.

15-210 uses this for all labs, so getting a fix for this or a new URL that works would be nice.

@ymzong ymzong added the bug label Jan 18, 2015
@ymzong ymzong added this to the S15 Semester milestone Jan 18, 2015
@dlbucci
Copy link
Member

dlbucci commented Jan 19, 2015

The unofficial_submit is now a route for autolab, so I think the problem is that the example submit script needs to be rewritten, but I'm not 100% sure that everything else is working.

@ymzong
Copy link
Member

ymzong commented Jan 21, 2015

We really want to fix the issue asap -- I see it bothering lots of students in 15-122 working on Windows... They should be able to run handin filea.c0 fileb.c0 on andrew, but now they need to:

  • make a tgz out of the submission files on afs;
  • use a transfer client to obtain a local copy;
  • manually submit the tgz to Autolab.

@robsimmons
Copy link

The "handin" file is actually /afs/andrew.cmu.edu/course/15/122/bin/handin, which calls /afs/andrew.cmu.edu/course/15/122/bin/handin/autolabSubmit-master.sh, which follows the following protocol:

Queries: http://unofficial.fish.ics.cs.cmu.edu/officialSubmit.rb?course=15122-s15&user=rjsimmon&assessment=scavhunt
Receives an AFS path in response
Places the handin tarball (handinscavhunt.tgz) in that directory
Queries: http://unofficial.fish.ics.cs.cmu.edu/officialSubmit.rb?course=15122-s15&user=rjsimmon&assessment=scavhunt&submit=handinscavhunt.tgz

I'm happy to hack my script, but I just don't know a lot of things, starting with what my source number is: "15122-s15" and "14" both give me "invalid course".

@dlbucci
Copy link
Member

dlbucci commented Jan 21, 2015

This can't be resolved until we fix our SSL setup: unofficial submit needs to use HTTP to get around the user needing HTTPS certificates, but our current Apache setup always forces HTTPS. We should be switching to Rails-enforced SSL instead of Apache, which will let Rails not force SSL for some routes. Then we can rewrite this script.

@icanb
Copy link
Member

icanb commented Jan 22, 2015

Hi @robsimmons, I'm working on fixing this as soon as possible. The unofficial route is working now, but the url is different. It's the part of the app now, so it can be reached through:

http://autolab.cs.cmu.edu/courses/{{COURSE_ID}}/assessments/{ASSESSMENT_ID}}/unofficial_submit?user={{USER_EMAIL}}&result={{anything}}

I'm not exactly sure about the expected behavior of officialSubmit and the code is pretty poorly documented at this point. Do you know of a way for me to debug this? I think I cleaned up the code but currently don't know of a way to test it. Any help and input would be great!

@robsimmons
Copy link

Is this pushed?

https://autolab.cs.cmu.edu/courses/14/assessments/49/unofficial_submit?user=robsimmons@gmail.com

gives me a DK

Error Information

--- !ruby/exception:SystemExit
message: exit

Stack Dump

/opt/autolab/build/Autolab/app/controllers/assessments_controller.rb:1196:in `exit'
/opt/autolab/build/Autolab/app/controllers/assessments_controller.rb:1196:in `unofficial_submit'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/abstract_controller/base.rb:198:in `process_action'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal/rendering.rb:10:in `process_action'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:117:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:117:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:151:in `block in halting_and_conditional'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:234:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:234:in `block in halting'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:151:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:151:in `block in halting_and_conditional'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:151:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:151:in `block in halting_and_conditional'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:151:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:151:in `block in halting_and_conditional'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:234:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:234:in `block in halting'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:92:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:92:in `_run_callbacks'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:734:in `_run_process_action_callbacks'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/abstract_controller/callbacks.rb:19:in `process_action'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal/rescue.rb:29:in `process_action'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in `block in instrument'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in `instrument'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/abstract_controller/base.rb:137:in `process'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionview-4.2.0/lib/action_view/rendering.rb:30:in `process'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal.rb:195:in `dispatch'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal.rb:236:in `block in action'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:73:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:42:in `serve'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/journey/router.rb:43:in `block in serve'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/journey/router.rb:30:in `each'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/journey/router.rb:30:in `serve'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:802:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/omniauth-1.2.2/lib/omniauth/strategy.rb:186:in `call!'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/omniauth-1.2.2/lib/omniauth/strategy.rb:164:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/omniauth-1.2.2/lib/omniauth/strategy.rb:186:in `call!'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/omniauth-1.2.2/lib/omniauth/strategy.rb:164:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/omniauth-1.2.2/lib/omniauth/strategy.rb:186:in `call!'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/omniauth-1.2.2/lib/omniauth/strategy.rb:164:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/exception_notification-f9dee5b5f6a1/lib/exception_notification/rack.rb:28:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-ssl-enforcer-0.2.8/lib/rack/ssl-enforcer.rb:52:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/warden-1.2.3/lib/warden/manager.rb:35:in `block in call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `catch'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/etag.rb:24:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/conditionalget.rb:25:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/head.rb:13:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/flash.rb:260:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/session/abstract/id.rb:225:in `context'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/session/abstract/id.rb:220:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/cookies.rb:560:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/query_cache.rb:36:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:647:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:88:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:88:in `_run_callbacks'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:734:in `_run_call_callbacks'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/rack/logger.rb:38:in `call_app'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/rack/logger.rb:20:in `block in call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:68:in `block in tagged'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:26:in `tagged'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:68:in `tagged'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/rack/logger.rb:20:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/request_id.rb:21:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/methodoverride.rb:22:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/runtime.rb:18:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/sendfile.rb:113:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/engine.rb:518:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/application.rb:164:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/railtie.rb:194:in `public_send'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/railtie.rb:194:in `method_missing'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/passenger-4.0.57/lib/phusion_passenger/rack/thread_handler_extension.rb:74:in `process_request'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/passenger-4.0.57/lib/phusion_passenger/request_handler/thread_handler.rb:141:in `accept_and_process_next_request'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/passenger-4.0.57/lib/phusion_passenger/request_handler/thread_handler.rb:109:in `main_loop'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/passenger-4.0.57/lib/phusion_passenger/request_handler.rb:455:in `block (3 levels) in start_threads'

@jez
Copy link
Contributor

jez commented Jan 22, 2015

@robsimmons Nope, we wanted to test it first. The pull request is still open: #163

@robsimmons
Copy link

More complete testing suggestion, though it's relative to prod because that's all I see. Is milkshark dev, or is it an exact alias of autolab.cs? If you're an account that's registered for 122:

https://autolab.cs.cmu.edu/courses/14/assessments/49/unofficial_submit?user=${{YOUR_EMAIL}}
This should give you an AFS address. wget the tarball
http://www.cs.cmu.edu/~rjsimmon/15122-s15/prog/pixels-handout.tgz
into that AFS directory, then call
https://autolab.cs.cmu.edu/courses/14/assessments/49/unofficial_submit?user=${{YOUR_EMAIL}}&submit=pixels-handout.tgz

and you should probably end up with one point.

@robsimmons
Copy link

Also I can work on this in my office on this from like 12:30 to 1:30 if that would be useful and if anyone wants to drop by then.

@icanb
Copy link
Member

icanb commented Jan 22, 2015

Thanks @robsimmons!

Firstly, to prevent future confusion, official_submit and unofficial_submit are different things. We use unofficial_submit for logging things for 213's bomblab and buflab. You need to use official_submit for the procedure you defined. (This actaully is terrible naming, so we should make it better. Any suggestions on what we should call this route?)

I fixed the error codes and checked out to that branch on production. So you can see it now. If you go to: https://autolab.cs.cmu.edu/courses/14/assessments/49/official_submit?user=robsimmons@gmail.com, you will get a handin directory.

I also needed to make some changes to the directory structure since we're trying to get rid of the Andrew dependencies. Currently it looks like this: 15122-s15/scavhunt/handin/robsimmons@gmail.com_remote_handin

Is this fine with you? I'm open to suggestions here too.

I'm working on the &submit= part now. It might take a little longer to fix and test. I was wondering if that request is a GET or POST. I believe that POST request would be more appropriate for the second one.

@dlbucci
Copy link
Member

dlbucci commented Jan 22, 2015

If you're doing a file upload on the submit call, it will need to be POST, but the first call can be a GET.

What if the routes were 'command_line_submit' and 'logger_submit'?

@robsimmons
Copy link

My shell script just wgets urls, so GET is waaaayyy easier.

Am I correct in understanding that there's actually some secretly-AFS-prefix I need to attach to the beginning of 15122-s15/scavhunt/handin/robsimmons@gmail.com_remote_handin in order to have the correct file path?

I think of "official_submit" as a "local" submission process - for when the user happens to have filesystem-local access to the autolab server - so I was going suggest "local_submit" myself.

@metalogical
Copy link
Author

Thanks Daniel! If I'm understanding things correctly, students need
permissions to dump files in the Autolab handin directory?

@robsimmons
Copy link

Oh, and to be clear: can you tell me what the secretly-AFS-prefix is because I don't know it :-)

@icanb
Copy link
Member

icanb commented Jan 22, 2015

"Places the handin tarball (handinscavhunt.tgz) in that directory"

So you actually cp the file yourself and just tell us the name of the file, right? In that case, GET request would actually be fine.

And yes, 15122-s15 is located in /afs/cs/academic/autolab/autolab2/courses just like all the other course material.

@dlbucci
Copy link
Member

dlbucci commented Jan 22, 2015

I'll just say that it's bad practice for HTTP GET requests to alter state. GET and HEAD are only meant for information retrieval. That said, if it's really that much of a pain and we're not uploading any files, GET is doable.

@jez
Copy link
Contributor

jez commented Jan 22, 2015

POSTing a file with curl isn't actually too complicated:

curl -X POST -d @<filename> http://...

I don't know what the scripts that use our route look like or how intricate their wget calls are, but a simple Google search returns this StackOverflow post explaining the same thing, so it shouldn't be too big of a required change.

@metalogical
Copy link
Author

One concern - are there security precautions in place to prevent a user
from submitting as someone else?

On Thu, Jan 22, 2015, 12:54 PM Jake Zimmerman notifications@github.com
wrote:

POSTing a file with curl isn't actually too complicated:

curl -X POST -d @ http://...

I don't know what the scripts that use our route look like or how
intricate their wget calls are, but a simple Google search returns this
StackOverflow post
http://stackoverflow.com/questions/3007253/send-post-xml-file-using-curl-command-line
explaining the same thing.


Reply to this email directly or view it on GitHub
#126 (comment).

@robsimmons
Copy link

I'll give it a try if you want to do the correct thing and make one of both of the protocol things a POST request. (Would you say the first request creates state by creating a directory?)

I think I understand the fragment of the script that 122 is using pretty well if you can explain the actions that it is supposed to take.

@robsimmons
Copy link

I currently see

$ fs listacl /afs/cs/academic/autolab/autolab2/courses/15122-s15/scavhunt/handin/rjsimmon@andrew.cmu.edu_remote_handin
fs: File '/afs/cs/academic/autolab/autolab2/courses/15122-s15/scavhunt/handin/rjsimmon@andrew.cmu.edu_remote_handin' doesn't exist

even after I visit https://autolab.cs.cmu.edu/courses/14/assessments/49/official_submit?user=rjsimmon@andrew.cmu.edu

@robsimmons
Copy link

@namanbharadwaj In theory the old directories could be access-locked to the individual who had the right to handin, since there username was the same, though I have no idea whether this, or security-via-obscurity-and-the-absense-of-race-conditions was the order of the day.

It would certainly make sense to limit this to andrew.cmu.edu email addresses and lock writes to the andrew id... probably the new system shouldn't be less secure than the old system if that used to be the protocol.

@dlbucci
Copy link
Member

dlbucci commented Jan 22, 2015

@namanbharadwaj That's what I've been concerned about, but I don't think it will be any less secure than before, if that's saying anything. I think @robsimmons makes a good point that this should be CMU-specific until we can think of a less hacky solution.

@icanb
Copy link
Member

icanb commented Jan 22, 2015

I actually see the directory:

fs listacl /afs/cs/academic/autolab/autolab2/courses/15122-s15/scavhunt/handin/rjsimmon@andrew.cmu.edu_remote_handin
Access list for /afs/cs/academic/autolab/autolab2/courses/15122-s15/scavhunt/handin/rjsimmon@andrew.cmu.edu_remote_handin is
Normal rights:
academic:write.15122 rlidwk
academic:admin.15122 rlidwka
academic:admin.autolab rlidwka
academic.autolab rlidwka
rjsimmon@andrew.cmu.edu rlidw

@jez
Copy link
Contributor

jez commented Jan 22, 2015

This might not be the best short term solution, but I see Git-based submissions where users can upload public keys (similar to GitHub) as being a viable long-term option for all command line submissions, CMU or otherwise.

@robsimmons
Copy link

Hmm... what are the file permissions for parent?

[rjsimmon@unix3 ~]$ fs listacl /afs/cs/academic/
Access list for /afs/cs/academic/ is
Normal rights:
  system:administrators rlidwka
  system:friendlyhost rl
  system:campushost rl
  system:anyuser l
[rjsimmon@unix3 ~]$ fs listacl /afs/cs/academic/autolab/
fs: You don't have the required access rights on '/afs/cs/academic/autolab/'
[rjsimmon@unix3 ~]$ fs listacl /afs/cs/academic/autolab/autolab2/
fs: File '/afs/cs/academic/autolab/autolab2/' doesn't exist
[rjsimmon@unix3 ~]$ fs listacl /afs/cs/academic/autolab/autolab2/courses/
fs: File '/afs/cs/academic/autolab/autolab2/courses/' doesn't exist
[rjsimmon@unix3 ~]$ fs listacl /afs/cs/academic/autolab/autolab2/courses/15122-s15/
fs: File '/afs/cs/academic/autolab/autolab2/courses/15122-s15/' doesn't exist

@icanb
Copy link
Member

icanb commented Jan 22, 2015

That's interesting. I'd expect you to have permissions for '/afs/cs/academic/autolab/autolab2/courses/15122-s15/' since you've been uploading the assignments etc. there.

Are you on a school computer? Did you try doing aklog cs.cmu.edu? It seems like the system doesn't recognize you.

@icanb
Copy link
Member

icanb commented Jan 22, 2015

Just pushed more changes. (We're getting there!)

The route is local_submit now.
https://autolab.cs.cmu.edu/courses/14/assessments/49/local_submit?user=robsimmons@gmail.com

The second request with &submit= should work now and it still accepts GET requests. (I'll change this to POST soon)

@icanb
Copy link
Member

icanb commented Jan 22, 2015

In the old system, the directory used to be: "/afs/andrew.cmu.edu/scs/cs/autolabEmail/handin/" + users's email

How did you prevent users from seeing each others' submissions?

@icanb
Copy link
Member

icanb commented Jan 22, 2015

I have two suggestions:

  1. You can define your own directory, and tell it to Autolab inside your request. The old url is pretty much hardcoded anyways, so we might as well hard-code it in handin script and keep our codebase clean. On submit request, Autolab would try to grab the file from the directory you've added as the parameter. e.g.:
    https://autolab.cs.cmu.edu/courses/14/assessments/49/local_submit?user=robsimmons@gmail.com&submit=scav.c&directory=/afs/andrew.cmu.edu/scs/cs/autolabEmail/handin/username/"

  2. You can cUrl the file with a POST request and Autolab can read the file and write to the appropriate directory.

@robsimmons
Copy link

Apparently Autolab automagically handled the permissions, which your suggestion wouldn't allow. Your solution also has the problem of being unable to ensure Autolab has access to the appropriate directory.

[rjsimmon@unix1 rjsimmon_strbuf]$ pwd
/afs/andrew.cmu.edu/scs/cs/autolabEmail/handin/rjsimmon_strbuf
[rjsimmon@unix1 rjsimmon_strbuf]$ fs listacl .
Access list for . is
Normal rights:
  droh:admin.autolab rlidwka
  postman:dlist rl
  system:anyuser l
  rjsimmon rlidw
  academic.autolab@cs.cmu.edu rlidwka
[rjsimmon@unix1 rjsimmon_strbuf]$ cd ..
[rjsimmon@unix1 handin]$ fs listacl .
Access list for . is
Normal rights:
  droh:admin.autolab rlidwka
  postman:dlist rl
  system:anyuser l
  98409 rlidwka
  academic.autolab@cs.cmu.edu rlidwka

@robsimmons
Copy link

Also, option 2 is terrifying because none of these HTTP requests include any authentication. So option 2 is much less secure than whatever the old system did, which was apparently a reasonably secure thing!

@robsimmons
Copy link

By the way: if this is the way it has to be for now, I think I can make do with this as it stands by making the script do the right funky AFS cross-domain registration stuff.

I just have to give students "l" AFS permisison to a lot of stuff that I'd really like them to not have any access to.

@metalogical
Copy link
Author

Students shouldn't need "l" rights on a parent directory in order to write
to a subdirectory to which they have permissions, if that's the concern
here.

On Thu, Jan 22, 2015, 2:26 PM Robert J. Simmons notifications@github.com
wrote:

By the way: if this is the way it has to be for now, I think I can make do
with this as it stands by making the script do the right funky AFS
cross-domain registration stuff.

I just have to give students "l" AFS permisison to a lot of stuff that I'd
really like them to not have any access to.


Reply to this email directly or view it on GitHub
#126 (comment).

@robsimmons
Copy link

I didn't think that was true, @namanbharadwaj. If I take rjsimmon@andrew.cmu.edu off of academic:admin.15122 I can't access that directory anymore

[rjsimmon@unix2 ~]$ whoami
rjsimmon
[rjsimmon@unix2 ~]$ hostname
unix2.andrew.cmu.edu
[rjsimmon@unix2 ~]$ aklog cs.cmu.edu
[rjsimmon@unix2 ~]$ cd /afs/cs.cmu.edu/academic/class/15122-s15/autolab/scavhunt/handin/rjsimmon@andrew.cmu.edu_remote_handin
/afs/cs.cmu.edu/academic/class/15122-s15/autolab/scavhunt/handin/rjsimmon@andrew.cmu.edu_remote_handin: Permission denied.
[rjsimmon@unix2 ~]$ mv a.c /afs/cs.cmu.edu/academic/class/15122-s15/autolab/scavhunt/handin/rjsimmon@andrew.cmu.edu_remote_handin
mv: accessing `/afs/cs.cmu.edu/academic/class/15122-s15/autolab/scavhunt/handin/rjsimmon@andrew.cmu.edu_remote_handin': Permission denied

@robsimmons
Copy link

(off topic) ...all my email addresses are going to be harvested off of this issue thread for the rest of time...

@robsimmons
Copy link

Okay, so some things.

Giving myself enough AFS permission that I can actually access the relevant directory again, I managed to play the game successfully by hand. Yay! I could turn this into a submit script:

bash-4.1$ LOCATION=`curl -k 'https://autolab.cs.cmu.edu/courses/14/assessments/49/local_submit?user=rjsimmon@andrew.cmu.edu'`
bash-4.1$ echo $LOCATION
scavhunt/handin/rjsimmon@andrew.cmu.edu_remote_handin
bash-4.1$ cp ~/private/s15/prog/scavhunt/handin.tgz /afs/cs/academic/class/15122-s15/autolab/$LOCATION
bash-4.1$ RESPONSE=`curl -k -F submit=handin.tgz 'https://autolab.cs.cmu.edu/courses/14/assessments/49/local_submit?user=rjsimmon@andrew.cmu.edu'`
bash-4.1$ echo $RESPONSE
Successfully submitted

But it didn't grade on autolab (and is incidentally ugly):
untitled-1

And going to "regrade" DKs:

Error Information

--- !ruby/exception:Errno::ENOENT
message: No such file or directory @ rb_sysopen - /opt/autolab/build/Autolab/courses/15122-s15/scavhunt/handin/opt/autolab/build/Autolab/courses/15122-s15/scavhunt/handin/rjsimmon@andrew.cmu.edu_remote_handin/handin.tgz

Stack Dump

/var/www/.rbenv/versions/2.2.0/lib/ruby/2.2.0/digest.rb:49:in `initialize'
/var/www/.rbenv/versions/2.2.0/lib/ruby/2.2.0/digest.rb:49:in `open'
/var/www/.rbenv/versions/2.2.0/lib/ruby/2.2.0/digest.rb:49:in `file'
/var/www/.rbenv/versions/2.2.0/lib/ruby/2.2.0/digest.rb:34:in `file'
/opt/autolab/build/Autolab/app/controllers/assessment/autograde.rb:81:in `block in createVm'
/opt/autolab/build/Autolab/app/controllers/assessment/autograde.rb:80:in `each'
/opt/autolab/build/Autolab/app/controllers/assessment/autograde.rb:80:in `createVm'
/opt/autolab/build/Autolab/app/controllers/submissions_controller.rb:187:in `regrade'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/abstract_controller/base.rb:198:in `process_action'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal/rendering.rb:10:in `process_action'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:117:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:117:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:151:in `block in halting_and_conditional'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:234:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:234:in `block in halting'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:151:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:151:in `block in halting_and_conditional'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:151:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:151:in `block in halting_and_conditional'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:151:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:151:in `block in halting_and_conditional'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:234:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:234:in `block in halting'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:92:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:92:in `_run_callbacks'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:734:in `_run_process_action_callbacks'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/abstract_controller/callbacks.rb:19:in `process_action'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal/rescue.rb:29:in `process_action'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in `block in instrument'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications.rb:164:in `instrument'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/abstract_controller/base.rb:137:in `process'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionview-4.2.0/lib/action_view/rendering.rb:30:in `process'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal.rb:195:in `dispatch'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal.rb:236:in `block in action'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:73:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:42:in `serve'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/journey/router.rb:43:in `block in serve'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/journey/router.rb:30:in `each'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/journey/router.rb:30:in `serve'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/routing/route_set.rb:802:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/omniauth-1.2.2/lib/omniauth/strategy.rb:186:in `call!'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/omniauth-1.2.2/lib/omniauth/strategy.rb:164:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/omniauth-1.2.2/lib/omniauth/strategy.rb:186:in `call!'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/omniauth-1.2.2/lib/omniauth/strategy.rb:164:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/omniauth-1.2.2/lib/omniauth/strategy.rb:186:in `call!'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/omniauth-1.2.2/lib/omniauth/strategy.rb:164:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/bundler/gems/exception_notification-f9dee5b5f6a1/lib/exception_notification/rack.rb:28:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-ssl-enforcer-0.2.8/lib/rack/ssl-enforcer.rb:52:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/warden-1.2.3/lib/warden/manager.rb:35:in `block in call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `catch'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/warden-1.2.3/lib/warden/manager.rb:34:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/etag.rb:24:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/conditionalget.rb:25:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/head.rb:13:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/flash.rb:260:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/session/abstract/id.rb:225:in `context'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/session/abstract/id.rb:220:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/cookies.rb:560:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/query_cache.rb:36:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:647:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:88:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:88:in `_run_callbacks'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:734:in `_run_call_callbacks'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/rack/logger.rb:38:in `call_app'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/rack/logger.rb:20:in `block in call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:68:in `block in tagged'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:26:in `tagged'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:68:in `tagged'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/rack/logger.rb:20:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/request_id.rb:21:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/methodoverride.rb:22:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/runtime.rb:18:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/sendfile.rb:113:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/engine.rb:518:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/application.rb:164:in `call'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/railtie.rb:194:in `public_send'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/railties-4.2.0/lib/rails/railtie.rb:194:in `method_missing'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/passenger-4.0.57/lib/phusion_passenger/rack/thread_handler_extension.rb:74:in `process_request'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/passenger-4.0.57/lib/phusion_passenger/request_handler/thread_handler.rb:141:in `accept_and_process_next_request'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/passenger-4.0.57/lib/phusion_passenger/request_handler/thread_handler.rb:109:in `main_loop'
/var/www/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/passenger-4.0.57/lib/phusion_passenger/request_handler.rb:455:in `block (3 levels) in start_threads'

This exposes another problem: the .tgz almost certainly need to be copied into the autolab handin directory as a regular submission, not left in the student-writable directory! (!!!!!!) Otherwise they will overwrite their handins the next time they submit, removing Autolab's (very useful to students, in a pinch) utility as a last-ditch version control system its utility (critical to me as an instructor) as a trustworthy and immutable recordkeeping of student submissions.

@icanb
Copy link
Member

icanb commented Jan 26, 2015

Hi @robsimmons, I've fixed the problem with the file name and location.

As for the permission, Autolab actually still automagically handles the afs permission. It gives the student rlidw permission to the director.

system("fs sa #{internalDir} #{@user.email} rlidw")

I also realized that adding aklog cs.cmu.edu to the script before cp'ing helps.

Can you test this and let me know? Everything seems to work for me.

@robsimmons
Copy link

I can see that I correctly have permission to

/afs/cs.cmu.edu/academic/class/15122-s15/autolab/pixels/handin/rjsimmon@andrew.cmu.edu_remote_handin

but I don't have "l" permission to the parent directories (which I really do think I need, @namanbharadwaj) so as long as I have taken rjsimmon@andrew.cmu.edu off of academic:admin.15122, I can't copy to that directory.

It seems to work if I add rjsimmon@andrew.cmu.edu back to academic:admin.15122, so we just need to figure out directory access and we're in business. Is there a barrier to having the handin directory be andrew-side and leaving the complicated cross-domain bits to Autolab?

@icanb
Copy link
Member

icanb commented Jan 26, 2015

I see. I just realized that it was working for me because I'm in autolab group... Sorry for that!

In this case what I'm planning to do is letting the instructor define that directory, so instead of hardcoding /afs/andrew.cmu.edu/scs/cs/autolabEmail/handin/ like we did before, it'll be a variable. I'm planning to get this in tonight. Thanks for your patience.

@robsimmons
Copy link

Okay - I can probably make that work, even if it's in the CS domain. Even better would be if the instructor-defined path could be in the andrew domain, but if that takes longer to get working then just do the cs thing.

@icanb
Copy link
Member

icanb commented Jan 27, 2015

So I created the variable and added as a setting. Under 'Edit Assessment > Handi', you'll see the Remote handin path field. I set it to /afs/andrew.cmu.edu/scs/cs/autolabEmail/handin/ for the scavhunt and it seems to work for me.

Note that you no longer need to add the prefix of /afs/cs/academic/class/15122-s15/autolab/ in the script.

@robsimmons
Copy link

Sounds good! Will that path be set as a default?

I'll poke at this in the morning.

@icanb
Copy link
Member

icanb commented Jan 27, 2015

It's not default, but we can do that if you'd like.

Also, I think you can get this to work on Andrew domain if you really don't want the CS domain. I just didn't know what path to use on andrew.

@robsimmons
Copy link

You currently have it working on the Andrew domain! /afs/andrew.cmu.edu/scs/cs/autolabEmail/handin is on Andrew :)

@robsimmons
Copy link

Thinking a bit more about paths: is what we want in general a course specific prefix followed by an (optional) assignment specific section? That way, the configuration you had before makes sense (course prefix: /afs/cs.cmu.edu/academic/class/15122-s15/autolab, assignment pixels/handin) and the configuration I'm asking for also makes sense (course prefix: /afs/andrew.cmu.edu/scs/cs/autolabEmail/handin, no assignment specific section).

@icanb
Copy link
Member

icanb commented Jan 27, 2015

Good point! I just pushed that change. The setting is still assessment based since I didn't want to move it to class settings, but the sub directory is called icanberk@andrew.cmu.edu_remote_handin_scavhunt so the handins for different assessments can not overwrite each other.

@robsimmons
Copy link

I can't imagine why this doesn't appropriately belong in class settings, but I guess you're the dev.

I think I can produce a working script with this, working on that now. Three requests:

  1. can you figure out why we have to add the (terrible for security) -k option to curl at the moment?
$ curl 'https://autolab.cs.cmu.edu/courses/14/assessments/49/local_submit?user=rjsimmon@andrew.cmu.edu'
curl: (60) Peer certificate cannot be authenticated with known CA certificates
More details here: http://curl.haxx.se/docs/sslcerts.html

curl performs SSL certificate verification by default, using a "bundle"
 of Certificate Authority (CA) public keys (CA certs). If the default
 bundle file isn't adequate, you can specify an alternate file
 using the --cacert option.
If this HTTPS server uses a certificate signed by a CA represented in
 the bundle, the certificate verification probably failed due to a
 problem with the certificate (it might be expired, or the name might
 not match the domain name in the URL).
If you'd like to turn off curl's verification of the certificate, use
 the -k (or --insecure) option.
  1. Is there a plan for adding pretty-course-names and assignment names? (15122-s15 instead of 14 and scavhunt instead of 49, or whatever)

  2. Is there a plan for integrating your thing pretty course names and assignment names?

@icanb
Copy link
Member

icanb commented Jan 27, 2015

You can use "http://autolab...." instead of "https://autolab..." this should solve the problem with the certificate.

We have plans to add the course name to the url, but I'm not sure about the timeline.

@icanb
Copy link
Member

icanb commented Jan 27, 2015

All the changes are merged to master.

@icanb icanb closed this as completed Jan 27, 2015
@jez jez mentioned this issue Feb 20, 2015
@dlbucci dlbucci modified the milestones: v1.1.0, S15 Semester (v1.0) Feb 20, 2015
@jez
Copy link
Contributor

jez commented Mar 25, 2015

We never made an issue for this but it was discussed here: we just merged a patch to add course names to URLs. We'll be rolling it out soon, but we'll make sure to give people enough time to change links. The unfortunate thing is that the two schemes aren't compatible with each other.

Reference: #424 .
/cc @robsimmons I think this addresses your last two points above.

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

6 participants