Production - Dropping the db and creating a new one does not present the create initial account window, essentially locked out?
Support Ticket
+issues
I was experimenting with a (pre)production server vm. After fiddling with the database I decided to start anew.
The website seems to be back but I'm not presented with the initial account creation page.
On the linux command line did a:
(to clear all active connections to the db)
sudo service postgresql restart
(to drop the db)
dropdb -h localhost -p 5432 -U "my-database-user" "my-database-name"
Then went to my old /var/www/my-website and did a:
rake wagn:create
This in my mind clears the whole thing... I was wrong.
Yep, in theory that should work. In fact, rake wagn:create should drop the db for you if it still exists.
I'm assuming you're seeing success from the rake wagn:create?
Two things that I could imagine going wrong:
1. the two aren't actually using the same database. You can research this by looking at the config/database.yml or even at the mysql table directly, for example by search in the cards table for a name.
2. everything worked but you haven't cleared the cache (which is now out of sync with the db). you can usually do this with rake wagn:reset_cache.
On 1:
I've only configured one db connection on database.yml and that is production, all the others are set to the default mysql which I don't even have set up. It's definetely just using the production pipe and seeing the same db, there is just one db-user and db setup on the entire system.
Tried 2, right after:
rake wagn:create (success, no errors)
rake wagn:reset_cache (no messages returned so I assume it executed and completed well)
Going to http://mysubdomain.mydomain.com/admin/setup I get:
Problems
EXCEPTION: Already setup
Trying to enter old credentials at sign in says user not found.
So in 1.12.13 is that Wagn looks to see how many users are in the users table. By default there should just be 2 (Wagn Bot and Anonymous). If there are more than 2 users in that table (which is no longer used after 1.13), then that is your problem. If there are not, then Wagn is using a cached version of that value, and something has gone wrong with the cache clearing.
How you clear the cache convincingly may depend on how your cache is set up. If it's file caching you may need to remove the tmp directory. If it's memcache, you may need to restart your memcache daemon...
I didn't enable any caching explicitly, so it might just be the default.
I use the latest stable gem 1.12.13 so it might be an issue with this. If this is deprecated in 1.13 then there is no need to worry since I just reverted to a previous image and won't recreate the database this way any more. No point in raising a ticket if it's going to be completely gone in the near future.
You might try deleting the entire tmp directory (/var/www/my-website/tmp). If you haven't messed with configuration options, there's a good chance the cache is there.
It works! Did a:
cd /var/www/my-website/tmp
then:
rm -rt cache
then rebooted (not really needed):
sudo reboot
It now presents me with the initial admin account creation. It seems the cache was the issue. Maybe it would be a good idea to add the removal of the cache directory automatically with the create or reset_cache?!
Yes, I'll file this as a bug with reset_cache and fix it one way or the other (removing the directory altogether seems like a fine idea to me). I was growing suspicious that something like this was happening. Thank you for confirming.