Open sfdi opened 7 years ago
I'm not sure it's that simple. I think exhibit creation is succeeding completely, but when you try to visit the exhibit's dashboard, you're getting an error (as, until then, nothing has required solr access). If you then start solr, everything should work fine, no?
I wonder if a better fix is to ensure that the admin dashboard doesn't break without solr? Obviously, though, without Solr available, the user's experience of the site will be highly degraded.
Yes, booting solr after the creation makes everything ok. I agree with your suggestion about fixing the dashboard to not break without solr; that error is a significant degradation in user experience. Should I create a new issue for that?
If Solr is inaccessible when creating an exhibit, Spotlight will (correctly) throw an exception. However, it will still create several records in the relational DB, including records in the
spotlight_exhibits
andtags
tables. Expected behavior would be to roll back the transactions and leave the DB untouched. Exhibit creation should either succeed or fail completely.To reproduce: Follow instructions given here: https://github.com/projectblacklight/spotlight/wiki/Contributing-to-Spotlight, specifically, from the cloned directory:
Note Solr has not been started. If desired, open the sqlite testing db found in
/.internal_test_app/db/development.sqlite3
with sqlite3 or similar and verify that thespotlight_exhibits
andtags
tables are empty.Open Spotlight in a browser, log in, and attempt to create an exhibit. This will correctly fail with the exception "Connection refused - Unable to connect to Solr instance", which is a
Blacklight::Exceptions::ECONNREFUSED
exception.Now, examine the
spotlight_exhibits
andtags
tables; they will hold entries for the exhibit we attempted to create.As a final note, I have not check all the other tables exhaustively. It may be that other tables were edited as well.
Reproduction carried out on https://github.com/TAMULib/spotlight/tree/master