Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

lib/tasks/portus.rake#L50 uninialized namespace #1036

Closed
EugenMayer opened this issue Aug 19, 2016 · 4 comments
Closed

lib/tasks/portus.rake#L50 uninialized namespace #1036

EugenMayer opened this issue Aug 19, 2016 · 4 comments

Comments

@EugenMayer
Copy link

looks like either namespace is not initialized yet or probably in some cases

portus      | rake aborted!
portus      | NoMethodError: undefined method `name' for nil:NilClass
portus      | /portus/lib/tasks/portus.rake:50:in `block (2 levels) in <top (required)>'

https://github.com/SUSE/Portus/blob/master/lib/tasks/portus.rake#L50
u.namespace.name

@monstermunchkin
Copy link
Contributor

This would be the expected behavior if there was no registry configured. Are you sure your registry is configured properly?

@mssola
Copy link
Collaborator

mssola commented Aug 24, 2016

Another possibility is that the user to be created was supposed to have a private namespace that clashed with an existing one. @EugenMayer maybe this is your case ? If so, we could extend that rake task to be more informative about this case.

@EugenMayer
Copy link
Author

@mssola it happens during initial bootstrap of a fresh portus using my test-repo https://github.com/EugenMayer/docker-image-portus/tree/master/test - if there is a namespace conflict, i am not sure "how" - its probably related to the entrypoint script https://github.com/EugenMayer/docker-image-portus/blob/master/build/startup.sh#L43

@mssola
Copy link
Collaborator

mssola commented Aug 30, 2016

Then it's exactly what @monstermunchkin said, you have to create the registry in the DB before creating users. From your startup.sh I see that you are creating the admin user right before creating the registry, you should do this the other way around 😉

From our side, maybe we can improve this by adding a check for the existence of a registry before doing anything at all. And it would also be nice from our side to provide a rake task for creating a new registry (I see that you have one of your own right ?)

mssola added a commit to mssola/Portus that referenced this issue Aug 31, 2016
Moreover, the portus:create_user taks has now a check preventing to create
users if there is no registry.

Fixes SUSE#1036

Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants