Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disk storage: symlink logic fails if using relative directories #4869

Closed
srenatus opened this issue Jul 11, 2022 · 0 comments · Fixed by #4870
Closed

disk storage: symlink logic fails if using relative directories #4869

srenatus opened this issue Jul 11, 2022 · 0 comments · Fixed by #4870
Labels

Comments

@srenatus
Copy link
Contributor

srenatus commented Jul 11, 2022

With an OPA config like

services:
  bundles:
    url: http://127.0.0.1:8000
bundles:
  perms:
    service: bundles
    resource: simple.tar.gz
storage:
  disk:
    directory: _tmp_simple
    auto_create: true

the server would create a symlink of

active -> _tmp_simple/backupXXXX

after successful bundle activation.

On restart, it would try to resolve _tmp_simple/active, and fail to find _tmp_simple/_tmp_simple/active:

error: initialize disk store: storage_internal_error: lstat _tmp_simple/_tmp_simple: no such file or directory

A workaround is to configure disk storage with absolute paths instead; the symlink will then be properly created.

Once the symlink is wrong, however, it needs to manually be fixed. In the _tmp_simple example above, that would be

rm _tmp_simple/active
ln -s backupXXXXX _tmp_simple/active
@srenatus srenatus added the bug label Jul 11, 2022
srenatus added a commit to srenatus/opa that referenced this issue Jul 11, 2022
So for now, we'll properly create the symlinks without the wrong indirection.

Fixes open-policy-agent#4869.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
srenatus added a commit that referenced this issue Jul 11, 2022
So for now, we'll properly create the symlinks without the wrong indirection.

Fixes #4869.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
srenatus added a commit to srenatus/opa that referenced this issue Jul 13, 2022
…nt#4870)

So for now, we'll properly create the symlinks without the wrong indirection.

Fixes open-policy-agent#4869.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
srenatus added a commit that referenced this issue Jul 13, 2022
So for now, we'll properly create the symlinks without the wrong indirection.

Fixes #4869.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant