generate solidus:install may fail silently despite errors or conflicts
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
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
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.
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?
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:))