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

--storage.file error #172

Closed
danteali opened this issue Aug 27, 2023 · 3 comments
Closed

--storage.file error #172

danteali opened this issue Aug 27, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@danteali
Copy link

danteali commented Aug 27, 2023

Describe the bug
When using command --storage.file="/etc/sablier/my-states.json" the container won't start and outputs error:

Bringing up specified services: sablier
[+] Running 1/1
 ✔ Container sablier  Started                                                                                                                                                                                                                                                    0.5s 
time="2023-08-27T00:14:59Z" level=info msg="(version=1.4.0-beta.4, branch=HEAD, revision=720dc57935715b17fa0ae848554f8fae96a7730b)"
time="2023-08-27T00:14:59Z" level=info msg="using provider \"docker\""
panic: open "/etc/sablier/my-states.json": no such file or directory

goroutine 1 [running]:
github.com/acouvreur/sablier/cmd.glob..func2.1(0xc000450f00?, {0x195d987?, 0x8?, 0x8?})
        /go/src/sablier/cmd/start.go:18 +0x98
github.com/spf13/cobra.(*Command).execute(0xc000450f00, {0xc0000ae080, 0x8, 0x8})
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:920 +0x847
github.com/spf13/cobra.(*Command).ExecuteC(0xc000450c00)
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:1044 +0x3bc
github.com/spf13/cobra.(*Command).Execute(...)
        /go/pkg/mod/github.com/spf13/[email protected]/command.go:968
github.com/acouvreur/sablier/cmd.Execute()
        /go/src/sablier/cmd/root.go:26 +0x1e
main.main()
        /go/src/sablier/main.go:10 +0x5a

The same error occurs whether I try to mount the file to the local filesystem or not (i.e. even if I have mounted a file to the correct path in the container it still says that no file exists).

If I instead try to do it with an environment variable (- STORAGE_FILE="/etc/sablier/my-states.json") the container does start but no file is created.

I also note that the docs for this setting state:

# File path to save the state (default stateless)

So by default (i.e. without specifying this config value) I didn't expect any state to be saved. But when the container is run without using this command arg or the environment variable the docker logs indicate that /etc/sablier/state.json is being used to save the state:

time="2023-08-27T00:17:08Z" level=info msg="initialized storage to /etc/sablier/state.json"

And the default /etc/cablier/sablier.yaml config file inside the container specifies:

storage:
  file: /etc/sablier/state.json

So it looks like the service is trying to save the state. However nothing seems to be written to this file at all, it remains unchanged when containers are started/stopped.

Context

  • Sablier version: 1.4.0-beta.4
  • Provider: docker
  • Reverse proxy: traefik v2.10.4
  • Sablier running inside a container? Y
@danteali danteali added the bug Something isn't working label Aug 27, 2023
@acouvreur
Copy link
Owner

That's right, the default config is stateful

file: /etc/sablier/state.json

I'll probably change that in the next release.

I'll investigate your storage initialization issue. Any update since ?

@danteali
Copy link
Author

danteali commented Feb 5, 2024

I haven't tried playing with saving states since I logged this.
I'm fine using using stateless.

If I get time later I'll try to re-start with save states enabled and let you know.

Copy link

github-actions bot commented Mar 7, 2024

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Mar 7, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 12, 2024
@acouvreur acouvreur reopened this Mar 15, 2024
@github-actions github-actions bot removed the Stale label Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants