easyengine icon indicating copy to clipboard operation
easyengine copied to clipboard

Broken after upgrade

Open dovy opened this issue 11 years ago • 27 comments

Today I did a ee update becuase it's been a while. Now ee is broke for me.

  • ee site create demo.redux.io --wpfc
    • Downloading WP-CLI [Errno 2] No such file or directory: '/usr/bin/wp'
  • root@reduxframework:/usr/bin# ee --version
    • EasyEngine v3.0.5
    • Copyright (c) 2015 rtCamp Solutions Pvt. Ltd.

Any ideas?

dovy avatar Mar 18 '15 20:03 dovy

Wird thought the ee update was removed and you had to use https://rtcamp.com/easyengine/docs/commands/ee-update/

benzon avatar Mar 18 '15 20:03 benzon

Try the following

ee stack install --wpcli

And then try and create a --wpfc site again.

benzon avatar Mar 18 '15 20:03 benzon

root@reduxframework:/var/www# ee stack install --wpcli Downloading WP-CLI [Errno 2] No such file or directory: '/usr/bin/wp'

dovy avatar Mar 18 '15 21:03 dovy

Just manually installed wp-cli and all is well with the world. :)

dovy avatar Mar 18 '15 21:03 dovy

Bah, now I'm getting:

root@reduxframework:/var/www# ee site create demo.redux.io --wpfc
Setting up NGINX configuration  [Done]
Setting up webroot      [Done]
Downloading Wordpress       [Done]
Setting up database     [Done]
Unable to Generate wp-config

Seems like I just need to re-install.

dovy avatar Mar 18 '15 21:03 dovy

Wird issues you got going, just tryed to update my servers my self, no issues or what so ever :(

benzon avatar Mar 18 '15 22:03 benzon

have you tryed ee stack install --web

benzon avatar Mar 18 '15 22:03 benzon

root@reduxframework:/home# ee stack install --web Nginx already installed PHP already installed MySQL connection is already alive Postfix is already installed WP-CLI is already installed

However now it does this:

root@reduxframework:/var/log/ee# ee site create demo.redux.io --wpfc
Setting up NGINX configuration  [Done]
Setting up webroot      [Done]
Downloading Wordpress       [Done]
Setting up database     Cannot setup database user

Which probably means on the upgrade it lost my mysql user/pass. Were are those stored?

dovy avatar Mar 18 '15 22:03 dovy

So I thought it was related to #454. So I made sure and reset the root password to the one listed in ~/.my.cnf. However, the problem still persists.

root@reduxframework:~# ee site create demo.redux.io --wpfc
Setting up NGINX configuration  [Done]
Setting up webroot      [Done]
Downloading Wordpress       [Done]
Setting up database     Cannot setup database user

Do you have an odd command in your most recent version? Do I need to update mysql? I originally had ee setup this server. So I'm confused by these issues.

dovy avatar Mar 18 '15 22:03 dovy

Great. Now my whole server is getting 502 Bad Gateway...

dovy avatar Mar 18 '15 22:03 dovy

Ok, so ee update forced a new update to /etc/php5/fpm/pool.d/www.conf. I allowed it to create a new file, thus throwing my server into shock.

Luckily it was smart enough to make a www.conf.dpkg-old backup. I restored that, did a service php-fpm restart and my server started working again.

However, now "cannot create database" or "cannot create database user" keeps happening...

dovy avatar Mar 18 '15 23:03 dovy

ee.log:

root@reduxframework:/var/log/ee# tail ee.log 
2015-03-18 23:04:08,358 (DEBUG) ee : Changing directory to /var/www/demo.redux.io/htdocs/
2015-03-18 23:04:08,358 (DEBUG) ee : Running command: wp --allow-root core download
2015-03-18 23:04:09,233 (INFO) ee : [Done]
2015-03-18 23:04:09,234 (INFO) ee : Setting up database     
2015-03-18 23:04:09,234 (DEBUG) ee : Creating databse demo_redux_io
2015-03-18 23:04:09,241 (DEBUG) ee : Executing MySQL statement: create database `demo_redux_io`
2015-03-18 23:04:09,242 (DEBUG) ee : Creating user demo_redux_io
2015-03-18 23:04:09,242 (DEBUG) ee : create user `demo_redux_io`@`localhost` identified by ''
2015-03-18 23:04:09,244 (DEBUG) ee : (1396, "#HY000Operation CREATE USER failed for 'demo_redux_io'@'localhost'")
2015-03-18 23:04:09,244 (ERROR) ee : Cannot setup database user

dovy avatar Mar 18 '15 23:03 dovy

Not sure if this is helpfull in any way, try and do ee stack migrate --mariadb

Make sure you got backup of your stuff, but ye if it's nothing big you got on the server, it might be faster to do a re-install.

I would hate reinstalling right now, since i got some quite large sites running.

benzon avatar Mar 18 '15 23:03 benzon

I have a few sites running... I'm worried about crashing.

dovy avatar Mar 19 '15 00:03 dovy

It's not ee. It's all in mysql. Can't create the user accounts after update of the stack...

dovy avatar Mar 19 '15 00:03 dovy

Ye that sound like a pain i the a**

Hope one of the dev's can kick in with some info on this, would be nice to know if it happens to me ad some point.

benzon avatar Mar 19 '15 00:03 benzon

OK, here's the resolution.

If for some reason the creation fails (wp-cli wasn't properly installed via an upgrade), then things linger.

So I had to do the following:

  1. Install wp-cli manually since it didn't install via upgrade.
  2. Remove the database manually - Even though it said the DB didn't exist, I had to manually delete it.
  3. Remove the user manually. If the DB isn't found, ee doesn't search for the user to clean things up.
  4. Delete the site and try again.

I think we should have extra checks. Even if it's not in the EE database, we should check if the db or user is there and prompt the user to delete them. It would have solved a whole ton of pain.

Also on creation we should check for an existing user. If there is, create another and go. Don't just error out and leave everything a mess.

Either way, that's the resolution. Not enough error checking in the setup site process. ;)

dovy avatar Mar 19 '15 02:03 dovy

@dovy what was the ee version from which you upgraded?

ghost avatar Mar 19 '15 02:03 ghost

I honestly do not know, but here's the log of the update.

https://gist.github.com/dovy/ec94a8f4db1ff280e9a9

dovy avatar Mar 19 '15 03:03 dovy

Thanks. I'll take a snapshot of the VM before I try!

ghost avatar Mar 19 '15 03:03 ghost