It is possible to create an archiver without credentials, and it fails

Bug #1433354 reported by Caio Begotti
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Capomastro
Fix Released
High
Caio Begotti

Bug Description

Testing the new Swift support I forgot to select its credential and got some errors on Capomastro. Apparently it's because we can choose betwen either SSH or Swift credentials but none is mandatory, so it is possible to "forget" setting it and the archiver creation succeeds nonetheless. One of them should be required, perhaps attached to the combo selection "Transport" right below it?.

This is what I see when it happens and I try to build something (more precisely the archiver fails):

[2015-03-17 19:43:54,491: INFO/Worker-1] Archiving vivid/2015-03-17-1426621391.0/vivid-preinstalled-touch-armhf.tar.gz sis.capomastro.staging.canonical.com default: True in archive sis.capomastro.staging.canonical.com default: True
[2015-03-17 19:43:54,493: DEBUG/Worker-1] (0.001) SELECT "jenkins_artifact"."id", "jenkins_artifact"."build_id", "jenkins_artifact"."filename", "jenkins_artifact"."url" FROM "jenkins_artifact" WHERE "jenkins_artifact"."id" = 13 ; args=(13,)
[2015-03-17 19:43:54,503: DEBUG/Worker-1] (0.009) SELECT "jenkins_build"."id", "jenkins_build"."job_id", "jenkins_build"."build_id", "jenkins_build"."number", "jenkins_build"."duration", "jenkins_build"."url", "jenkins_build"."phase", "jenkins_build"."status", "jenkins_build"."console_log", "jenkins_build"."parameters", "jenkins_build"."created_at", "jenkins_build"."requested_by_id" FROM "jenkins_build" WHERE "jenkins_build"."id" = 8 ; args=(8,)
[2015-03-17 19:43:54,509: DEBUG/Worker-1] (0.001) SELECT "jenkins_job"."id", "jenkins_job"."server_id", "jenkins_job"."jobtype_id", "jenkins_job"."name" FROM "jenkins_job" WHERE "jenkins_job"."id" = 2 ; args=(2,)
[2015-03-17 19:43:54,511: DEBUG/Worker-1] (0.001) SELECT "jenkins_jenkinsserver"."id", "jenkins_jenkinsserver"."name", "jenkins_jenkinsserver"."url", "jenkins_jenkinsserver"."username", "jenkins_jenkinsserver"."password" FROM "jenkins_jenkinsserver" WHERE "jenkins_jenkinsserver"."id" = 1 ; args=(1,)
[2015-03-17 19:43:54,514: ERROR/MainProcess] Task archives.tasks.process_build_artifacts[1aa60646-b06f-41ad-861a-f68c99c068a1] raised unexpected: AttributeError("'NoneType' object has no attribute 'auth_version'",)
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/celery/app/trace.py", line 218, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/celery/app/trace.py", line 398, in __protected_call__
    return self.run(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/archives/tasks.py", line 107, in process_build_artifacts
    rest]).apply()
  File "/usr/lib/python2.7/dist-packages/celery/canvas.py", line 173, in apply
    return self.type.apply(args, kwargs, **options)
  File "/usr/lib/python2.7/dist-packages/celery/app/builtins.py", line 314, in apply
    last and (last.get(), ),
  File "/usr/lib/python2.7/dist-packages/celery/result.py", line 765, in get
    raise self.result
AttributeError: 'NoneType' object has no attribute 'auth_version'
[2015-03-17 19:45:02,356: DEBUG/MainProcess] pidbox received method ping() [reply_to:{u'routing_key': u'ab173e50-04bf-3b67-9a59-8f43f45f27b9', u'exchange': u'reply.celery.pidbox'} ticket:a56d670e-1c6a-43d0-b5f9-25dec6ed1e27]

The attribute auth_version should come from the credentials I was missing.

Related branches

Revision history for this message
Daniel Manrique (roadmr) wrote :

Either the model or the view should validate that if a non-local transport is chosen, an appropriate set of credentials is associated. I'm not sure if Django best practice is to do it in the view or the model. Worth researching as part of this bug :)

Changed in capomastro:
importance: Undecided → High
status: New → Triaged
milestone: none → 2015-05
Caio Begotti (caio1982)
Changed in capomastro:
assignee: nobody → Caio Begotti (caio1982)
Caio Begotti (caio1982)
Changed in capomastro:
status: Triaged → Fix Committed
Caio Begotti (caio1982)
Changed in capomastro:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.