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

Docker container does not come up #265

Open
rucksman opened this issue Jul 24, 2023 · 7 comments
Open

Docker container does not come up #265

rucksman opened this issue Jul 24, 2023 · 7 comments

Comments

@rucksman
Copy link

rucksman commented Jul 24, 2023

I try to start the docker container as described, but it will not start. I tried it "as is" without any modification (besides renaming .env.example to .env) and also fully customized, but I always get this error:

onetime-app    | Bundle complete! 20 Gemfile dependencies, 34 gems now installed.
onetime-app    | Use `bundle info [gemname]` to see where a bundled gem is installed.
onetime-app    | /app/lib/onetime/core_ext.rb:30: warning: constant ::Fixnum is deprecated
onetime-app    | /usr/local/bundle/gems/attic-0.5.3/lib/attic.rb:13: warning: constant ::Fixnum is deprecated
onetime-app    | /usr/local/bundle/gems/gibbler-0.8.9/lib/gibbler.rb:654: warning: constant ::Fixnum is deprecated
onetime-app    | /usr/local/bundle/gems/gibbler-0.8.9/lib/gibbler.rb:655: warning: constant ::Bignum is deprecated
onetime-app    | onetime[1]: no implicit conversion of nil into String
onetime-app    | Error loading config:
onetime-app    | onetime[1]: Error loading config:

Then I renamed etc/config.example to etc/config but a new error occured:

onetime-app    | Bundle complete! 20 Gemfile dependencies, 34 gems now installed.
onetime-app    | Use `bundle info [gemname]` to see where a bundled gem is installed.
onetime-app    | /app/lib/onetime/core_ext.rb:30: warning: constant ::Fixnum is deprecated
onetime-app    | /usr/local/bundle/gems/attic-0.5.3/lib/attic.rb:13: warning: constant ::Fixnum is deprecated
onetime-app    | /usr/local/bundle/gems/gibbler-0.8.9/lib/gibbler.rb:654: warning: constant ::Fixnum is deprecated
onetime-app    | /usr/local/bundle/gems/gibbler-0.8.9/lib/gibbler.rb:655: warning: constant ::Bignum is deprecated
onetime-app    | bundler: failed to load command: thin (/usr/local/bundle/bin/thin)
onetime-app    | bundler: failed to load command: bundle (/usr/local/bundle/bin/bundle)
onetime-app    | /usr/local/lib/ruby/2.6.0/erb.rb:901:in `eval': (erb):8: syntax error, unexpected ';', expecting ')' (SyntaxError)
onetime-app    | ...e=false&logging=false' ).to_s); _erbout.<< "\n  :config: /et...
onetime-app    | ...                              ^
onetime-app    |        from /usr/local/lib/ruby/2.6.0/erb.rb:901:in `result'

Any help would be appreciated!

@emilyHere6
Copy link

In the etc/config there is a syntax error where there should be a closed parenthesis after the redis information. So a ")" is missing there

@rucksman
Copy link
Author

rucksman commented Jul 24, 2023

Thanks for the quick answer. After adding the ")" and after doing "docker compose up -d" it now stops at

Container onetime-redis Creating

It never finishes creating the container.

@rucksman
Copy link
Author

So I overcame this problem, and the next occurs. From my understanding the port in ONETIMESECRET_REDIS_URL is wrong. It says 7179, but I think it should be 6379. Am I wrong?

Anyways, after correcting the port, I get:

onetimesecret-app      | Bundle complete! 20 Gemfile dependencies, 34 gems now installed.
onetimesecret-app      | Use `bundle info [gemname]` to see where a bundled gem is installed.
onetimesecret-app      | /app/lib/onetime/core_ext.rb:30: warning: constant ::Fixnum is deprecated
onetimesecret-app      | /usr/local/bundle/gems/attic-0.5.3/lib/attic.rb:13: warning: constant ::Fixnum is deprecated
onetimesecret-app      | /usr/local/bundle/gems/gibbler-0.8.9/lib/gibbler.rb:654: warning: constant ::Fixnum is deprecated
onetimesecret-app      | /usr/local/bundle/gems/gibbler-0.8.9/lib/gibbler.rb:655: warning: constant ::Bignum is deprecated
onetimesecret-app      | bundler: failed to load command: thin (/usr/local/bundle/bin/thin)
onetimesecret-app      | bundler: failed to load command: bundle (/usr/local/bundle/bin/bundle)
onetimesecret-app      | /usr/local/bundle/gems/redis-2.2.2/lib/redis/client.rb:47:in `call': ERR AUTH <password> called without any password configured for the default user. Are you sure your configuration is correct? (RuntimeError)

I changed passwords in .env and redis.conf. By the way: in etc/config it says:
:config: /etc/onetime/redis.conf
Is this path correct? I would guess it should be :config: /etc/redis.conf. But this does not help, I still get the above error.

Could someone please share a working docker-compose file and the various config files? Thanks a lot!!!

@emilyHere6
Copy link

I had luck by not specifying user or pass in the config file on line 4 "'redis://@localhost'sIP:6379/0?timeout=10&thread_safe=false&logging=false') %>"
I still cannot figure out how to get it to identify my redis.conf file. It doesn't seem to matter what path I put there are a couple references in this project and I have tried changing them all, albeit not at the same time. So even if you comment out the requirepass, it doesn't matter it seems because it uses a default redis instead of using your config file. Let me know if you figure that out

@antonymous
Copy link

antonymous commented Sep 17, 2023

Here's how to tell Redis to use your own config file:

# docker-compose.yml
services:
  redis:
    command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
    volumes:
      - ./etc/redis.conf:/usr/local/etc/redis/redis.conf

Also since Redis URL is used from app container, it must refer to redis container, not localhost:

# config.example
:redis:
  :uri: <%= ENV['ONETIMESECRET_REDIS_URL'] || 'redis://CHANGEME@redis:6379/0?timeout=10&thread_safe=false&logging=false' %>
  :config: /etc/redis.conf

@madtempest
Copy link

Some new info:

Ensure that you can connect to the redis database and also ensure that the redis container is stood up with a default password.

This got it working for me.

@rcarrascoz
Copy link

Hi, could you explain me how it is working? I left changeme to test, on my redis.conf, .env and config files... could ou explain what can I do?
thanks a lot,
Rafa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants