Bug #3961

[API] 9tee4: cannot create subproject under Home

Added by Tim Pierce about 5 years ago. Updated about 5 years ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Tim Pierce
Category:
API
Target version:
Start date:
09/29/2014
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Story points:
0.5

Description

When Abram attempted to create a subproject under his Home project, he got "something went wrong" from Workbench.

Proposed fix:
  • Add test for the ensure_unique_name feature that doesn't use admin privileges
  • Make the test pass (probably need to clear @object.uuid in the rescue code in services/api/app/controllers/arvados/v1/application_controller.rb)
  • While you're at it, remove the debug printf "params[:ensure_unique_name] is ..."

API server error log:

params[:ensure_unique_name] is true
Completed 200 OK in 13.9ms (Views: 0.5ms | ActiveRecord: 6.0ms)
#<ActiveRecord::RecordInvalid: Validation failed: Uuid assignment not permittid>
[...]
/data/www/qr1hi.arvadosapi.com/releases/20140924002613/app/controllers/application_controller.rb:84:in `create'

The Workbench production.log showed the following stack trace:

Started POST "/projects?options%5Bensure_unique_name%5D=true&project%5Bowner_uuid%5D=9tee4-tpzed-2l9nsfm4mgltv4c" for 74.118.24.162 at 2014-09-23 18:17:23 +0000
Processing by ProjectsController#create as HTML
  Parameters: {"authenticity_token"=>"Bfkre5x/EACSb2qk7QhPzdm5f1IFR5/qs3R81Y943Nc=", "options"=>{"ensure_unique_name"=>"true"}, "project"=>{"owner_uuid"=>"9tee4-tpzed-2l9nsfm4mgltv4c"}}
#<ArvadosApiClient::ApiErrorResponseException: Uuid assignment not permittid [API: 422]>
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/app/models/arvados_api_client.rb:147:in `api'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/app/models/arvados_base.rb:182:in `save'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/app/controllers/application_controller.rb:284:in `create'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/app/controllers/projects_controller.rb:239:in `create'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_controller/metal/implicit_render.rb:4:in `send_action'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/abstract_controller/base.rb:189:in `process_action'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_controller/metal/rendering.rb:10:in `process_action'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/abstract_controller/callbacks.rb:20:in `block in process_action'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:113:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:113:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:166:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:166:in `block in halting'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:149:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:149:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:149:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:149:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:149:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:149:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:149:in `block in halting_and_conditional'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:282:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:282:in `block (2 levels) in halting_and_conditional'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/app/controllers/application_controller.rb:509:in `require_thread_api_token'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:424:in `block in make_lambda'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:281:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:281:in `block in halting_and_conditional'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:299:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:299:in `block (2 levels) in halting'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/app/controllers/application_controller.rb:492:in `set_thread_api_token'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:424:in `block in make_lambda'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:298:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:298:in `block in halting'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:299:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:299:in `block (2 levels) in halting'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/app/controllers/application_controller.rb:422:in `thread_clear'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:424:in `block in make_lambda'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:298:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:298:in `block in halting'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:229:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:229:in `block in halting'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:166:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:166:in `block in halting'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:166:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:166:in `block in halting'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:86:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:86:in `run_callbacks'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/abstract_controller/callbacks.rb:19:in `process_action'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_controller/metal/rescue.rb:29:in `process_action'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_controller/metal/instrumentation.rb:31:in `block in process_action'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/notifications.rb:159:in `block in instrument'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/notifications.rb:159:in `instrument'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_controller/metal/instrumentation.rb:30:in `process_action'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_controller/metal/params_wrapper.rb:250:in `process_action'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/railties/controller_runtime.rb:18:in `process_action'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/abstract_controller/base.rb:136:in `process'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionview-4.1.1/lib/action_view/rendering.rb:30:in `process'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_controller/metal.rb:195:in `dispatch'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_controller/metal/rack_delegation.rb:13:in `dispatch'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_controller/metal.rb:231:in `block in action'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/routing/route_set.rb:80:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/routing/route_set.rb:80:in `dispatch'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/routing/route_set.rb:48:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/journey/router.rb:71:in `block in call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/journey/router.rb:59:in `each'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/journey/router.rb:59:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/routing/route_set.rb:676:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/etag.rb:23:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/conditionalget.rb:35:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/flash.rb:254:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:in `context'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/cookies.rb:560:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/query_cache.rb:36:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:621:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/callbacks.rb:82:in `run_callbacks'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/remote_ip.rb:76:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/rack/logger.rb:38:in `call_app'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/rack/logger.rb:20:in `block in call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/tagged_logging.rb:68:in `block in tagged'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/tagged_logging.rb:26:in `tagged'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/tagged_logging.rb:68:in `tagged'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/rack/logger.rb:20:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/request_id.rb:21:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/runtime.rb:17:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/activesupport-4.1.1/lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/middleware/static.rb:64:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/rack-1.5.2/lib/rack/sendfile.rb:112:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/engine.rb:514:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/application.rb:144:in `call'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/railtie.rb:194:in `public_send'
/var/www/workbench.9tee4.arvadosapi.com/releases/20140923133609/vendor/bundle/ruby/2.1.0/gems/railties-4.1.1/lib/rails/railtie.rb:194:in `method_missing'
/usr/lib/ruby/vendor_ruby/phusion_passenger/rack/thread_handler_extension.rb:74:in `process_request'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:141:in `accept_and_process_next_request'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler/thread_handler.rb:109:in `main_loop'
/usr/lib/ruby/vendor_ruby/phusion_passenger/request_handler.rb:448:in `block (3 levels) in start_threads'

  Rendered application/_report_error.html.erb (0.8ms)
  Rendered application/api_error.html.erb within layouts/application (2.3ms)
  Rendered application/_projects_tree_menu.html.erb (1.5ms)
  Rendered layouts/body.html.erb (31.6ms)
Completed 500 Internal Server Error in 340ms

ActionView::Template::Error (No route matches {:action=>"show", :controller=>"projects", :id=>nil} missing required keys: [:id]):
    195:                 <i class="fa fa-lg fa-angle-double-right"></i>
    196:               </li>
    197:               <li>
    198:                 <%= link_to(p.name, project_path(p.uuid), data: {object_uuid: p.uuid, name: 'name'}) %>
    199:               </li>
    200:             <% end %>
    201:           <% end %>
  app/views/layouts/body.html.erb:198:in `block in _app_views_layouts_body_html_erb___516149708720097588_62215020'
  app/views/layouts/body.html.erb:193:in `each'
  app/views/layouts/body.html.erb:193:in `_app_views_layouts_body_html_erb___516149708720097588_62215020'
  app/views/layouts/application.html.erb:47:in `_app_views_layouts_application_html_erb__1146100671781025949_59115640'
  app/controllers/application_controller.rb:49:in `block (2 levels) in render_error'
  app/controllers/application_controller.rb:43:in `render_error'
  app/controllers/application_controller.rb:90:in `render_exception'

Subtasks

Task #4023: Review 3961-uuid-assignment-not-permittedResolvedRadhika Chippada

Task #4020: make ensure_unique_name to work without admin privilegesResolvedTim Pierce

Associated revisions

Revision b506247f (diff)
Added by Tom Clegg about 5 years ago

Fix typo in error message. Refs #3961

Revision 6319bc18
Added by Tim Pierce about 5 years ago

Merge branch '3961-uuid-assignment-not-permitted'

Closes #3961.

Revision 84798b73
Added by Tim Pierce about 5 years ago

Merge branch '3961-uuid-assignment-not-permitted'

Closes #3961.

History

#1 Updated by Tim Pierce about 5 years ago

  • Subject changed from cannot create subproject under Home to 9tee4: cannot create subproject under Home
  • Description updated (diff)

#2 Updated by Tim Pierce about 5 years ago

  • Target version changed from Bug Triage to 2014-10-08 sprint

#3 Updated by Tim Pierce about 5 years ago

  • Subject changed from 9tee4: cannot create subproject under Home to [API] 9tee4: cannot create subproject under Home
  • Category set to API
  • Assigned To set to Tim Pierce

#4 Updated by Tom Clegg about 5 years ago

  • Description updated (diff)

#5 Updated by Tim Pierce about 5 years ago

  • Status changed from New to In Progress

#6 Updated by Tom Clegg about 5 years ago

  • Story points set to 0.5

#7 Updated by Radhika Chippada about 5 years ago

Tim,
My test earlier was incorrect; I should not point my workbench to 9tee4 apiserver to test, since the update you made is on the apiserver side.

Hence, I retested locally by creating sub-projects under my home project (and hence causing name collisions on 'New project'). However, I noticed that it works for me even if I were to comment out the line "@object.uuid = nil" in the application_controller.rb.

Hence, I am not really sure if the issue is resolved or not. I will talk to you tomorrow about it and first identify how to reproduce the issue. Thanks.
--Radhika

#8 Updated by Tim Pierce about 5 years ago

This ticket fixes a bug in the API server, not in Workbench. Running a local Workbench against the 9tee4 API server won't do anything to test the change.

If you want to test it locally, it will require: running a workbench against a test API server on your workstation and logging in as a non-admin user. But if you feel that the functional test here doesn't adequately test the change, please let me know so we can figure out how to test it properly.

#9 Updated by Radhika Chippada about 5 years ago

Tim,

  • I was not sure this pointer from Tom in the description "Make the test pass (probably need to clear @object.uuid in the rescue code in services/api/app/controllers/arvados/v1/application_controller.rb)" is a suggestion for test only or is the suggested fix. If this is the suggested fix, the test does fail if object uuid is not reset.
  • I was wondering if it would be desirable to add a test that tests sub-project creation (also), since this is the bug reported.

#10 Updated by Tim Pierce about 5 years ago

Radhika Chippada wrote:

Tim,

  • I was not sure this pointer from Tom in the description "Make the test pass (probably need to clear @object.uuid in the rescue code in services/api/app/controllers/arvados/v1/application_controller.rb)" is a suggestion for test only or is the suggested fix. If this is the suggested fix, the test does fail if object uuid is not reset.

If the test exercises the condition that we're trying to fix -- i.e. that a non-privileged user can create an object with ensure_unique_names set -- then making the test pass is sufficient to demonstrate that the code fixes the problem.

  • I was wondering if it would be desirable to add a test that tests sub-project creation (also), since this is the bug reported.
That seems reasonable. dc29394 adds tests for:
  • unprivileged user creating a subproject under 'Home', duplicating an existing project they own (returns 422)
  • unprivileged user creating a subproject under 'Home', duplicating an existing project name and with ensure_unique_name=true (succeeds)

#11 Updated by Radhika Chippada about 5 years ago

Tim,
Thanks for the new tests, they are quite helpful. I think adding a couple more assertions would be nice.

  • test 'creating subproject with duplicate name fails'
    • Can you also verify that the json response has an error message and it contains the string "duplicate key" or something like that?
  • test 'creating duplicate named subproject succeeds with ensure_unique_name'
    • It might improve readability to name the json_response as created object.
    • Also, it would help if you add an error message to assertions. Something as follows:
          assert_response :success
          created = json_response
          assert_not_equal(created['uuid'], groups(:aproject).uuid, 'Found created object uuid to be the same same as of aproject')
          assert_not_equal(created['name'], 'A Project', 'Found create project name to be the same as of aproject')
          assert_equal(created['name'], 'A Project (2)', 'Did not found expected project name')
      

LGTM, with or without those additional assertions. Thanks.

#12 Updated by Tim Pierce about 5 years ago

Those seem like good ideas. Added the relevant assertions at 6d6de24 and pushed.

Merging based on your LGTM, but of course let me know if you see anything else that you think would be good to add.

#13 Updated by Tim Pierce about 5 years ago

  • Status changed from In Progress to Resolved

Applied in changeset arvados|commit:6319bc1895aaf8d2a7f944e45e52c960f931a11e.

Also available in: Atom PDF