question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Permission denied on relation-get

See original GitHub issue

Today I saw the following error on the juju logs, and when running the command with juju run I get the same error:

$ juju run --unit slurmctld/leader "relation-get -r 71 - slurmdbd --app"
ERROR permission denied

Here are some logs:

machine-32: 17:16:27 DEBUG jujuc running hook tool "relation-list" for slurmctld/11-slurmd-relation-created-2533241742911058760
machine-32: 17:16:27 DEBUG jujuc running hook tool "relation-get" for slurmctld/11-slurmd-relation-created-2533241742911058760
machine-32: 17:16:27 DEBUG jujuc running hook tool "juju-log" for slurmctld/11-slurmd-relation-created-2533241742911058760
machine-32: 17:16:27 ERROR unit.slurmctld/11.juju-log slurmd:72: Uncaught exception while in charm code:
Traceback (most recent call last):
  File "/var/lib/juju/agents/unit-slurmctld-11/charm/venv/ops/model.py", line 1284, in _run
    result = run(args, **kwargs)
  File "/usr/lib64/python3.6/subprocess.py", line 438, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '('/var/lib/juju/tools/unit-slurmctld-11/relation-get', '-r', '71', '-', 'slurmdbd', '--app', '--format=json')' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./src/charm.py", line 415, in <module>
    main(SlurmctldCharm)
  File "/var/lib/juju/agents/unit-slurmctld-11/charm/venv/ops/main.py", line 404, in main
    framework.reemit()
  File "/var/lib/juju/agents/unit-slurmctld-11/charm/venv/ops/framework.py", line 732, in reemit
    self._reemit()
  File "/var/lib/juju/agents/unit-slurmctld-11/charm/venv/ops/framework.py", line 767, in _reemit
    custom_handler(event)
  File "/var/lib/juju/agents/unit-slurmctld-11/charm/src/interface_slurmd.py", line 63, in _on_relation_created
    if not self._charm.slurmdbd_info:
  File "./src/charm.py", line 85, in slurmdbd_info
    return self._slurmdbd.get_slurmdbd_info()
  File "/var/lib/juju/agents/unit-slurmctld-11/charm/src/interface_slurmdbd.py", line 111, in get_slurmdbd_info
    if app_data:
  File "/var/lib/juju/agents/unit-slurmctld-11/charm/venv/ops/model.py", line 394, in __len__
    return len(self._data)
  File "/var/lib/juju/agents/unit-slurmctld-11/charm/venv/ops/model.py", line 384, in _data
    data = self._lazy_data = self._load()
  File "/var/lib/juju/agents/unit-slurmctld-11/charm/venv/ops/model.py", line 748, in _load
    return self._backend.relation_get(self.relation.id, self._entity.name, self._is_app)
  File "/var/lib/juju/agents/unit-slurmctld-11/charm/venv/ops/model.py", line 1351, in relation_get
    return self._run(*args, return_output=True, use_json=True)
  File "/var/lib/juju/agents/unit-slurmctld-11/charm/venv/ops/model.py", line 1286, in _run
    raise ModelError(e.stderr)
ops.model.ModelError: b'ERROR permission denied\n'
unit-slurmctld-11: 17:16:27 ERROR juju.worker.uniter.operation hook "slurmd-relation-created" (via hook dispatching script: dispatch) failed: exit status 1
unit-slurmctld-11: 17:16:27 DEBUG juju.machinelock machine lock released for slurmctld/11 uniter (run relation-created (72; app: slurmd) hook)

The charm code that triggered this error is here

Juju controller 2.9.4, Juju client 2.9.4.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
jnsgrukcommented, Sep 28, 2021

Closing this issue for now, the discussion continues at: https://bugs.launchpad.net/juju/+bug/1911010. I think this is not likely to be fixed by OF, but rather in Juju. Thanks for the feedback! 😃

1reaction
rbarry82commented, Jul 21, 2021

Let’s continue this discussion on Launchpad. Strictly speaking, permissions on data bags are “below” the operator framework, and all we can do here is inherit Juju’s permissions/behavior.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug #1239681 “relation-get failing with 'permission denied'”
The PostgreSQL test suite is no longer passing with Juju 1.16 and the local provider, with relation-get failing with 'permission denied' ...
Read more >
postgresql - Permission denied for relation <table>
When I login as bspu , and try to query the users table, I get the error: permission denied for relation users. I...
Read more >
gptransfer Failed with "ERROR: permission denied for relation"
When attempting data migration between two databases with gptransfer, it fails with error message “ERROR: permission denied for relation”.
Read more >
Total Import permission denied - opencart - Stack Overflow
I tried to go to system->users->users groups->administrator->Modify Permission but I can't find the permission for TotalI mport.
Read more >
Error: Permission denied (publickey) - GitHub Docs
A "Permission denied" error means that the server rejected your connection. There could be several reasons why, and the most common examples are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found