Local Community

SQL/Database issues after upgrading to Local 2.4

Same here! None of my sites are able to establish a connection with the databases.
Sequel Pro is not helping either, of course.
Also, Local doesn’t seem to be able to create a new site, the installation of the new environment stops in the middle and then the interface vanishes.

Have you downgraded a Preferred Environment site to a custom setting with 5.5.6 and it worked.
I can’t believe this massive breaking update and no one from local is responding.

Hi all,

If you’re having this issue, please provide your local-by-flywheel.log file as well as the MySQL log files for the site you’re having trouble with. You can find the site logs files in the logs folder next to the site’s app folder.

I’m very sorry for the trouble!

The update to v2.4.0 broke my installation of LBF. None too happy about it as it’s disrupted my workflow today.

Here are some observations that may assist you in troubleshooting the problem.

Sites running a local environment version 1.2 (configured to run Apache server, PHP v7.2.0, and MySQL 5.6.34) will launch and render perfectly fine in the browser. I can login to the Admin page from the front-end. Database connections are fine.

I was just prompted, and updated the dev dependencies on a local environment to version 1.3.1. That update broke the DB connection. When I select either ‘View Site’ or ‘Admin’ from the LBP UI, the actual WordPress PHP file renders in the browser (e.g. Front to the WordPress Application; Admin page, or the login page). That tells me that the connection to the DB is broken while the site files remain intact and operative.

I would gladly provide you with a LBP log file if could tell me where to generate it from.

Can you suggest how to check and reestablish DB connections between my site files and DB?

Right now, I don’t know how to troubleshoot this issue any further.

About my computer: MacOs 10.13.6 (High Sierra)

I will add that an attempt to launch a new site with LBP v2.4.0 failed.

When starting a new site on Local ( url: newtestsite.local ) , I receive the following message:

Warning: This path has existing files and may be overwritten.

Button: Use path and overwrite files.

Attempted to set up new site with
PHP: v7.1.4
Server: nginx
MySQL: 5.6

Error message: ‘/app/public/wp-includes/version.php’ does not exist.

Error! WordPress installation failed.

@robertg,

Thanks for the details! We’re keeping an eye on this.

See How do I retrieve Local's log file?

@clay I suspect you and your team are not going to have much of a weekend, given all the trouble today.

I can create new site.
After updating currents site, they are inaccessible. No database connection.
Hangs on creating site container.
Quit the app, now it won’t load.
Is there anyway to downgrade to previous version?

MacOs High Sierra
10.13.6local-by-flywheel.log (520.5 KB)

Same here. Seems it can’t find mySQL 5.7. I can create new sites with mySQL 5.6.

If you’re experiencing this issue and need to restore your site immediately, please follow the steps here: Restoring From Only Local Site files.


If anyone else has details such as what version you upgraded from and/or logs to provide, we’d greatly appreciate it!

@clay Attached is the local-by-flywheel.log file for 09-21-18. local-by-flywheel.log (24.0 KB)

I have upgraded from a custom environment 1.2.0 (Apache, PHP 7.1.3, MySQL 5.6.34).

  • existing sites that have been upgraded don’t work
  • existing sites that don’t have been upgraded don’t work
  • new site using preferred environment (PHP 7.2.9, Nginx + Varnish, MySQL 5.7) don’t work

local-by-flywheel.log (348.1 KB)

YMMV… for me when I get the
Uh-oh! Local ran into an issue while backing up site’s database to the site’s “app/sql” directory.

Please check the local-by-flywheel.log file for more details.

What often will fix it for me is cloning or clone/updating the site, then deleting the clone. Yeah, really, it’s weird I don’t know why, something about initiating the clone “fixes” the original site as best as I’ve been able to tell.

@clay I was unpleasantly surprised, and later frustrated about the breaking change introduced to LBF with the version 2.4.0. update earlier today.

Saw good reviews in the forum for packaging a *.sql dump and the /wp-content/ directory into an archive package, and then importing to LBF. As I was preparing to pursue that option, I found the ‘Clone’ site option on the right-click of my touchpad (I use a MacBook Air).

There’s an important project that I was blocked from working on today after updating the site server environment from v1.2 to 1.3.1. The DB connection to the site files broke. When I select the ‘View Site’ button in the Local UI, the code for the site index.php file appears in the browser. Select the ‘Admin’ button in the Local UI, and the code for the /wp-admin/index.php file displays in the browser.

I was able to successfully clone the broken site and rename it. It appears that the site is back up and running on Local. It includes the new server environment changes. Will have to check my Git repository on the site, and make sure it points to the correct remote repo. [Update: It was cloned too! ] This is a big step forward in getting back on track.

Best of luck to the Local development team in fixing the v2.4.0 release. Posting this here hoping that others might find my experience useful.

Robert

I’m also having a similar issue.

All (I assume all, I’ve spot checked about 5 but I don’t have time to check all 45 of the sites I have installed) of my sites are throwing the Error establishing a database connection error.

I had been trying to create a new project this morning, which never completed. I tried three or four times creating a new one from scratch, but it always just hung at “Installing WordPress”. I waited over a half hour for it to finish once and it never did.

Then I tried downloading a backup zip of the existing site from Flywheel (hosting) and importing it that way, but it just gets stuck at “Provisioning WP-CLI”.

I’m completely unable to get any work done locally right now and it’s very frustrating.

Edit:
Here is what I get when I try to UPDATE ENVIRONMENT on an existing site:

    { stdout: '', stderr: '' }
    Sep 24, 2018, 10:36 AM CDT - warn: [main/waitForMySQL] waitForMySQL Response: 
    { stdout: '', stderr: '' }
    Sep 24, 2018, 10:36 AM CDT - warn: [main/waitForMySQL] waitForMySQL Response: 
    { stdout: '', stderr: '' }
    Sep 24, 2018, 10:36 AM CDT - error: [main/changeSiteEnvironment]  Error
        at /Applications/Local by Flywheel.app/Contents/Resources/app.asar/main/actions-sites/wait-for-mysql.js:1:2754
        at Generator.next (<anonymous>)
        at _0x48423e (/Applications/Local by Flywheel.app/Contents/Resources/app.asar/main/actions-sites/wait-for-mysql.js:1:1621)
        at Object.wrTIQ (/Applications/Local by Flywheel.app/Contents/Resources/app.asar/main/actions-sites/wait-for-mysql.js:1:1168)
        at Object.xrPCq (/Applications/Local by Flywheel.app/Contents/Resources/app.asar/main/actions-sites/wait-for-mysql.js:1:1420)
        at /Applications/Local by Flywheel.app/Contents/Resources/app.asar/main/actions-sites/wait-for-mysql.js:1:1880
        at <anonymous>
        at process._tickDomainCallback (internal/process/next_tick.js:228:7)
    Sep 24, 2018, 10:36 AM CDT - warn: [main/waitForMySQL] waitForMySQL Response: 
    { stdout: '', stderr: '' }
    Sep 24, 2018, 10:36 AM CDT - warn: [main/waitForMySQL] waitForMySQL Response: 
    { stdout: '', stderr: '' }```

On sites that are experiencing the " Error establishing a database connection" issue, if I SSH in and run service mysql status I get [info] MySQL is stopped.. so if I then run service mysql start I then get [FAIL] /etc/init.d/mysql: ERROR: The partition with /var/lib/mysql is too full! ... failed!

That’s interesting. So then if I run a df -h I get this:

Filesystem                                                           Size  Used Avail Use% Mounted on
none                                                                  18G   18G     0 100% /
tmpfs                                                                 64M     0   64M   0% /dev
tmpfs                                                                498M     0  498M   0% /sys/fs/cgroup
shm                                                                   64M     0   64M   0% /dev/shm
192.168.75.1:/Users/username/Local Sites/projectname/app          466G  231G  229G  51% /app
192.168.75.1:/Users/username/Local Sites/projectname/conf/php     466G  231G  229G  51% /conf/php
192.168.75.1:/Users/username/Local Sites/projectname/conf/apache  466G  231G  229G  51% /etc/apache2
/dev/sda1                                                             18G   18G     0 100% /etc/hosts
192.168.75.1:/Users/username/Local Sites/projectname/logs/mysql   466G  231G  229G  51% /var/log/mysql
192.168.75.1:/Users/username/Local Sites/projectname/logs/nginx   466G  231G  229G  51% /var/log/nginx
192.168.75.1:/Users/username/Local Sites/projectname/logs/php     466G  231G  229G  51% /var/log/php
192.168.75.1:/Users/username/Local Sites/projectname/conf/nginx   466G  231G  229G  51% /etc/nginx/wordpress
192.168.75.1:/Users/username/Local Sites/projectname/logs/apache  466G  231G  229G  51% /var/log/apache2
tmpfs                                                                498M     0  498M   0% /proc/scsi
tmpfs                                                                498M     0  498M   0% /sys/firmware

Not sure where those numbers are coming from. My SSD is 500gb, so to see a site that is supposedly 466gb doesn’t make sense.

Oh and when I SSH in to a site and try to export a DB (so I can back everything up before I kill LBF), I get:

root@db2bf8d92ed2:/app/public# wp db export
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111) when trying to connect
root@db2bf8d92ed2:/app/public# 

which I guess makes sense if MySQL isn’t running. Still furstrating as there is no clear way to get a backup of a site’s BD.

I just tried this and got:

Error
    at /Applications/Local by Flywheel.app/Contents/Resources/app.asar/main/actions-sites/wait-for-mysql.js:1:2754
    at Generator.next (<anonymous>)
    at _0x48423e (/Applications/Local by Flywheel.app/Contents/Resources/app.asar/main/actions-sites/wait-for-mysql.js:1:1621)
    at Object.wrTIQ (/Applications/Local by Flywheel.app/Contents/Resources/app.asar/main/actions-sites/wait-for-mysql.js:1:1168)
    at Object.xrPCq (/Applications/Local by Flywheel.app/Contents/Resources/app.asar/main/actions-sites/wait-for-mysql.js:1:1420)
    at /Applications/Local by Flywheel.app/Contents/Resources/app.asar/main/actions-sites/wait-for-mysql.js:1:1880
    at <anonymous>
    at process._tickDomainCallback (internal/process/next_tick.js:228:7) 

So yeah, mysql is just borked.

So has anyone had success with 2.4.1, the apparent fix?
I installed the so called fix and still can’t use the preferred environment with MySQL 5.7
I cannot create new sites, update environments of old sites or recover databases from the previous 2.4 botched sites.

2.4.1 hasn’t fixed anything for me. My sites are all out of whack, cannot create new sites or import/update.