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 Image 1.51.5 - MariaDB upgrade failure #3122

Open
jmkrm opened this issue Feb 24, 2025 · 8 comments
Open

Docker Image 1.51.5 - MariaDB upgrade failure #3122

jmkrm opened this issue Feb 24, 2025 · 8 comments

Comments

@jmkrm
Copy link

jmkrm commented Feb 24, 2025

We are running the official Docker Image together with a MariaDB database in another container (mariadb:latest).

When we upgrade the pwpush Image from 1.51.4 to 1.51.5 using the latest tag, the DB upgrade fails and the application crashes.

/usr/local/bin/bundle:25:in 'Kernel#load'
/usr/local/bin/bundle:25:in '<main>'
Tasks: TOP => db:migrate => db:load_config => environment
(See full trace by running task with --trace)
Password Pusher Version: 1.51.5

According to DATABASE_URL database backend is set to mysql2:...

Password Pusher: migrating database to latest...
rake aborted!
NoMethodError: undefined method 'downcase' for nil (NoMethodError)

  config.timeout_in = Settings.login_session_timeout.to_s.strip.split(" ").then { |n, u| n.to_i.send(u.downcase.to_sym) }
                                                                                                      ^^^^^^^^^
/opt/PasswordPusher/config/initializers/devise.rb:194:in 'block (2 levels) in <main>'

Switching back to the 1.51.4 Image resolves this issue, which is the workaround we are currently using.

Copy link

Hello @jmkrm, thanks for contributing to the Password Pusher community! We will respond as soon as possible.

@justinkruit
Copy link

Came here to report the same.

@tol0
Copy link

tol0 commented Feb 24, 2025

Same here with postgresql.

@pglombardo
Copy link
Owner

Thanks for reporting all/apologies for the issue.

Settings.login_session_timeout is a new setting in config/settings.yml with a default set in config/defaults/settings.yml.

I just booted a vanilla v1.51.5 and one with logins enabled and they booted without issue:

Image
Image

Do you guys have the the defaults file in your containers? /opt/PasswordPusher/config/defaults/settings.yml?

I believe this is happening because somehow the default isn't being set.

If you want a quick work-around, you could simply set PWP__LOGIN_SESSION_TIMEOUT='2 hours' but things might break again the next time I add another config option.

@tol0
Copy link

tol0 commented Feb 25, 2025

I have to set
login_session_timeout: '2 hours'
in my settings.yml, then I was able to start the container. And yes, defaults file is in place:

fd91fb13a0e6:/$ cat /opt/PasswordPusher/config/defaults/settings.yml | grep SESSION_TIMEOUT
# PWP__LOGIN_SESSION_TIMEOUT='2 hours'

@pglombardo
Copy link
Owner

That default should have been set in the config/defaults/settings.yml file for you. I'm not sure why not but glad that it's working.

@bigbeka
Copy link

bigbeka commented Feb 25, 2025

Adding login_session_timeout: '2 hours' to my /opt/PasswordPusher/config/settings.yml (not default) helped.

@pglombardo could the issue be with read/write permissions?

@pglombardo
Copy link
Owner

could the issue be with read/write permissions?

I wouldn't think so but might be possible. My original thought was that some might have a docker mount that hides the config/defaults/ directory.

Before config/settings.yml and environment variables are loaded, we load that defaults file first here.

# Prepend defaults to the Settings object in case users are missing some of the latest settings
Settings.prepend_source!(Rails.root.join("config/defaults/settings.yml").to_s)

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