SQL/Database issues after upgrading to Local 2.4

@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.

Yup all work gone. Can’t they just give us links to download pre 2.4 version? People have client work and money on the line.

Same issues here - this is a massive massive problem. I was told to email local@getflywheel.com with my logs and a picture of what is happening. It seems like MySQL is not running - when I try to jump into Sequel Pro I end up with what appears to be either wrong permissions or that the actual MySQL DB isn’t running. I’m giving this about 4 hours before I just move things to Mamp Pro and run the old fashioned way. I can’t honestly afford to have downtime like this over updating an app.

Same issue here.

2018-09-25 22:39:07 432 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
2018-09-25 22:39:07 432 [Note] Plugin ‘FEDERATED’ is disabled.
2018-09-25 22:39:07 432 [Note] InnoDB: Using atomics to ref count buffer pool pages
2018-09-25 22:39:07 432 [Note] InnoDB: The InnoDB memory heap is disabled
2018-09-25 22:39:07 432 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2018-09-25 22:39:07 432 [Note] InnoDB: Memory barrier is not used
2018-09-25 22:39:07 432 [Note] InnoDB: Compressed tables use zlib 1.2.8
2018-09-25 22:39:07 432 [Note] InnoDB: Using Linux native AIO
2018-09-25 22:39:07 432 [Note] InnoDB: Using CPU crc32 instructions
2018-09-25 22:39:07 432 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2018-09-25 22:39:07 432 [Note] InnoDB: Completed initialization of buffer pool
2018-09-25 22:39:08 432 [Note] InnoDB: Highest supported file format is Barracuda.
2018-09-25 22:39:08 432 [Note] InnoDB: The log sequence numbers 1595675 and 1595675 in ibdata files do not match the log sequence number 1595916 in the ib_logfiles!
2018-09-25 22:39:08 432 [Note] InnoDB: Database was not shutdown normally!
2018-09-25 22:39:08 432 [Note] InnoDB: Starting crash recovery.
2018-09-25 22:39:08 432 [Note] InnoDB: Reading tablespace information from the .ibd files…
2018-09-25 22:39:08 432 [Note] InnoDB: Restoring possible half-written data pages
2018-09-25 22:39:08 432 [Note] InnoDB: from the doublewrite buffer…
2018-09-25 22:39:08 432 [Note] InnoDB: 128 rollback segment(s) are active.
2018-09-25 22:39:08 432 [Note] InnoDB: Creating tablespace and datafile system tables.
2018-09-25 22:39:08 7f87ddea4740 InnoDB: Error: Write to file ./ib_logfile0 failed at offset 2048.
InnoDB: 4608 bytes should have been written, only 2048 were written.
InnoDB: Operating system error number 2.
InnoDB: Check that your OS and file system support files of this size.
InnoDB: Check also that the disk is not full or a disk quota exceeded.
InnoDB: Error number 2 means ‘No such file or directory’.
InnoDB: Some operating system error numbers are described at
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/operating-system-error-codes.html
2018-09-25 22:39:08 7f87ddea4740 InnoDB: Assertion failure in thread 140221520430912 in file fil0fil.cc line 5764
InnoDB: Failing assertion: ret
InnoDB: We intentionally generate a memory trap.
InnoDB: Submit a detailed bug report to http://bugs.mysql.com.
InnoDB: If you get repeated assertion failures or crashes, even
InnoDB: immediately after the mysqld startup, there may be
InnoDB: corruption in the InnoDB tablespace. Please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.6/en/forcing-innodb-recovery.html
InnoDB: about forcing recovery.
22:39:08 UTC - mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

key_buffer_size=16777216
read_buffer_size=131072
max_used_connections=0
max_threads=151
thread_count=0
connection_count=0
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 76300 K bytes of memory
Hope that’s ok; if not, decrease some variables in the equation.

Thread pointer: 0x0
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong…
stack_bottom = 0 thread_stack 0x30000
mysqld(my_print_stacktrace+0x2c)[0x8c317c]
mysqld(handle_fatal_signal+0x481)[0x661c61]
/lib/x86_64-linux-gnu/libpthread.so.0(+0xf890)[0x7f87dda85890]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37)[0x7f87dc47b067]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x148)[0x7f87dc47c448]
mysqld[0xa8bc64]
mysqld[0x96178f]
mysqld[0x961c99]
mysqld[0x9fc351]
mysqld[0x9fc5b9]
mysqld[0x9fcacd]
mysqld[0xa5c708]
mysqld[0x9e27df]
mysqld[0x922b48]
mysqld(_Z24ha_initialize_handlertonP13st_plugin_int+0x48)[0x5ab438]
mysqld[0x6e31f1]
mysqld(_Z11plugin_initPiPPci+0x8f0)[0x6e9750]
mysqld(_Z11mysqld_mainiPPc+0x857)[0x5a46a7]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5)[0x7f87dc467b45]
mysqld[0x5984ed]
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.

error.log (4.5 KB)

Just tried to clone a site and received the following error:

Error: Error calling “changeApacheConfig” method in “changeSiteDomain” hook.

TypeError: Cannot read property ‘replace’ of undefined
at exports.(anonymous function) (/Applications/Local by Flywheel.app/Contents/Resources/app.asar/helpers/replace-in-file.js:1:749)
at _0x473044 (/Applications/Local by Flywheel.app/Contents/Resources/extraResources/environments/custom-1-2-0/out/environment.js:1:16314)
at new Promise ()
at Function.changeApacheConfig (/Applications/Local by Flywheel.app/Contents/Resources/extraResources/environments/custom-1-2-0/out/environment.js:1:15616)
at /Applications/Local by Flywheel.app/Contents/Resources/app.asar/main/HooksMain.js:1:2177
at Generator.next ()
at _0x3fa212 (/Applications/Local by Flywheel.app/Contents/Resources/app.asar/main/HooksMain.js:1:1149)
at /Applications/Local by Flywheel.app/Contents/Resources/app.asar/main/HooksMain.js:1:1370
at
at process._tickDomainCallback (internal/process/next_tick.js:228:7)
at /Applications/Local by Flywheel.app/Contents/Resources/app.asar/main/HooksMain.js:1:2245
at Generator.throw ()
at _0x3fa212 (/Applications/Local by Flywheel.app/Contents/Resources/app.asar/main/HooksMain.js:1:1149)
at /Applications/Local by Flywheel.app/Contents/Resources/app.asar/main/HooksMain.js:1:1428
at
at process._tickDomainCallback (internal/process/next_tick.js:228:7)

Did anyone manage to get this resolved? I’m having the same issue and tearing my hair out over here.

local-by-flywheel.log (928.9 KB)

I hope I have uploaded what you need correctly. I am unsure where to find the MySQL log files if you can tell me where that is? I desperately need to access this site for a client ASAP. A swift response would be much appreciated.

Hey @forstergemma

From the Local log it looks like something is preventing access to the database – maybe some sort of Antivirus, or security settings.

  • What OS are you using and what version is it that is being used?
  • Are you able to create new, blank WordPress sites?

If you are able to create a new WordPress site, I would recommend trying to recreate the site from a backup.

To your question about where the mysql logs are found – if you open the site folder, there should be an app folder and a logs folder. The logs folder has all of the logs for the various services of the site. You might be able to see any errors being generated for MySQL.

– Ben

  • I am using mcOS Mojave Version 10.14.1
  • Yes I am able to create a new blank Wordpress site
  • I cannot recreate the site as I don’t have a backup. It was still in development mode. This is why I desperately need to access the site.
  • I have checked for the MySQL log but there is nothing in logs/mysql folder at all. No logs. There are numerous files in app/sql but nothing that looks like a log.

Please can you tell me how to move forward as I have a client waiting for this site to be completed.

Many thanks

Gemma

Hey @forstergemma

Thanks for your patience here! Since there are sql files within the original site folder, you should be able to zip up the site’s app folder and then drag and drop it onto Local.

That should ask you to re-import the site into a new Local site.

Let me know if that helps get the site back up and running!

– Ben

That worked, thanks!

1 Like

Hello, same think for me today !


local-by-flywheel.log (245.8 KB) error.log (487.9 KB)

I am using mcOS Mojave Version 10.14.5
Yes I am able to create a new blank Wordpress site
I have only one updraft recovery
The Sql log error is join with local-by-flywheels.log.

MY WEBSITE IS SHUTDOWN.
I need to delivery the website in 2days.Help Please
Thanks you a lot!

Hey @Nathan74

The “502 Request Error” is fairly common. Can you take a look at this FAQ and see if the troubleshooting steps help fix things?

If the error doesn’t go away after a few seconds, then the next step would be to try and restore the site to a new local site by zipping up the site’s app folder and then drag and drop it onto Local.

That should ask you to re-import the site into a new Local site.

Let me know if that helps get the site back up and running!

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.