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

generate solidus:install may fail silently despite errors or conflicts #6035

Open
debreczeni opened this issue Dec 15, 2024 · 4 comments
Open

Comments

@debreczeni
Copy link

debreczeni commented Dec 15, 2024

Solidus installation does not check for an existing database, it then fails with the migration silently, then seeding fails too, consequently the schema.rb is not being updated, and as a side effect it silently ignores the Gemfile update, and reports a successful installation.
It should not give a success message when it failed, and it should have failded (or asked what to do) with the existing database. In my case I had an older installation which I forgot about, which used the same app name and database name.

Solidus Version:
4.4.2

To Reproduce
Fresh versions as of today:
ruby 3.3.6 (through brew - ruby-build - rbenv)
gem install rails 7.2.2.1
rails new AppName --skip-bootsnap --database=postgresql
bundle add solidus -v 4.4.2
bin/rails generate solidus:install --frontend=starter

Current behavior
Install process returns with success message complete Solidus has been installed successfully. Enjoy! while encountering errors during installation, like:

rake aborted!
StandardError: An error has occurred, this and all later migrations canceled: (StandardError)

PG::DuplicateTable: ERROR:  relation "active_storage_blobs" already exists

Original error caused by database conflict not checked for, maybe that is another expected behaviour, or considered a user error and it is all good enough as it is for rockandroll...

Expected behavior
Installation should fail when encountering errors in general, or provide an alternative to allow to fix the issue and continue installation after the conflict has been resolved, for instance, with a conflicting database.

Desktop:

  • OS: mac os 13.6.4

Smartphone :
N/A

@tvdeyen
Copy link
Member

tvdeyen commented Dec 17, 2024

Solidus v4.3 is not compatible with Rails 7.2. You need to use the released version of v4.4.2 from Rubygems. Just install it via bundler

bundle add solidus --version=4.4.2

@debreczeni
Copy link
Author

debreczeni commented Dec 18, 2024

Hi @tvdeyen
Thank you for your reply. Sorry my bad, bundler probably added the existing solidus version. I have restarted everything from scratch, and although I was now aware of needing a clean state for everything before install, I have just checked if the same error still applies, and the installer would still fail silently returning with a success message even though some steps have failed. I have updated the original issue accordingly.

@debreczeni debreczeni changed the title Fresh New installation "Fails Successfully" Fresh New installation Fails Silently despite errors or conflicts Dec 18, 2024
@debreczeni debreczeni changed the title Fresh New installation Fails Silently despite errors or conflicts New installation may Fail Silently despite errors or conflicts Dec 18, 2024
@debreczeni debreczeni changed the title New installation may Fail Silently despite errors or conflicts generate solidus:install may fail silently despite errors or conflicts Dec 18, 2024
@tvdeyen
Copy link
Member

tvdeyen commented Dec 18, 2024

It looks like the database already includes the active storage tables. Do you have a vanilla rails app or is this an existing one? But actually the solidus installer should have skipped existing migrations. Do you have two active storage migrations in your db/migrate folder now?

@debreczeni
Copy link
Author

It looks like the database already includes the active storage tables. Do you have a vanilla rails app or is this an existing one? But actually the solidus installer should have skipped existing migrations. Do you have two active storage migrations in your db/migrate folder now?

Since I have re-started everything from scratch so it is all good now, I just run the test to see if the issue of not checking for an existing database or silent failure of the consequences is still there. I am not sure it is worth investigating as the whole point of Solidus is to have absolute control which comes with its own drawbacks (I need to know what I am doing exactly:))

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

2 participants