I am using MAAS with real servers and they are enlisting, commissioning etc. and power cycling nicely. Now its time for Juju.

I did this:

$ sudo snap install juju --classic
$ juju add-cloud
$ juju add-credential daleks
Enter credential name: d-cred

Using auth-type "oauth1".

Enter maas-oauth:

ERROR cannot update credentials for daleks: permission denied

Q: For the add-cloud, add-credential, and then bootstrap.... do I need sudo?

If I use sudo for the add-credential, it seems like its kicking the problem (with root file ownership) down the chain.

  • I've gone down the "do it with sudo" route, and that's just contaminated my .local/share/juju files with root file ownerships, which prevented other operations. I've also completely uninstalled juju, and deleted the .local/share/juju dir. – Gregory R. Sudderth Jul 10 at 21:31
  • Short answer, no. Juju never requires sudo to bootstrap (for Juju 2.x) – thumper Jul 11 at 1:59
up vote 1 down vote accepted

Discussed on IRC and in the end the problem was a combination of issues (as it often is).

The permission denied was on the flock file that is used to synchronize access to the local juju configuration for the user. That had previously had its ownership changed to root though an unneeded 'sudo'. That file can be found at $TMP/juju-store-lock*. The file can safely be removed as long as you know noone else is using juju on that machine. Actually there is one of these store-lock files for each user on the machine that is using juju. The suffix of the file is a hash of the path.

We need to do better at returning a more meaningful error message to lead the operator to discover the source of the problem themselves. But we have also landed a fix recently (2.4.1 timeframe) that detects if sudo is used when dealing with the lock file and it makes sure the ownership doesn't change.

  • Great idea. That fix needs a meme name because its a perma-problem for all tools (ALL!) that need sudo for something like this: sudo maas-region apikey --username=$PROFILE . – Gregory R. Sudderth Jul 11 at 7:29

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.