Errors when trying to do mysqldump via shell script

What issue or error are you experiencing?

I’m attempting to use instawp that requires doing some mysql command line tasks. I have one machine where it works and another where it does not. When I open a shell in Local I get several errors referring to lightning in local and mysqldump errors. I’m betting this has something to do with how my zsh is setup but not sure. Since it’s machine specific the folks at instawp don’t appear to be helping

Error below

Launching shell: /bin/zsh ...
corey@Coreys-MBP public % wp instawp local push
Failed loading /Users/corey/Library/Application Support/Local/lightning-services/php-8.0.22+6/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20200930/opcache.so:  dlopen(/Users/corey/Library/Application Support/Local/lightning-services/php-8.0.22+6/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20200930/opcache.so, 0x0009): symbol not found in flat namespace '__zend_get_parameters_array_ex'
Failed loading /Users/corey/Library/Application Support/Local/lightning-services/php-8.0.22+6/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20200930/xdebug.so:  dlopen(/Users/corey/Library/Application Support/Local/lightning-services/php-8.0.22+6/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20200930/xdebug.so, 0x0009): symbol not found in flat namespace '__zend_get_parameters_array_ex'
Success: Files backup created successfully.
Failed loading /Users/corey/Library/Application Support/Local/lightning-services/php-8.0.22+6/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20200930/opcache.so:  dlopen(/Users/corey/Library/Application Support/Local/lightning-services/php-8.0.22+6/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20200930/opcache.so, 0x0009): symbol not found in flat namespace '__zend_get_parameters_array_ex'
Failed loading /Users/corey/Library/Application Support/Local/lightning-services/php-8.0.22+6/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20200930/xdebug.so:  dlopen(/Users/corey/Library/Application Support/Local/lightning-services/php-8.0.22+6/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20200930/xdebug.so, 0x0009): symbol not found in flat namespace '__zend_get_parameters_array_ex'
env: mysqldump: No such file or directory
Warning: Failed to get current character set of the posts table. Reason: env: mysql: No such file or directory

What steps can be taken to replicate the issue? Feel free to include screenshots, videos, etc


System Details

  • Local Version:
    Version 8.2.1+6583
  • Operating System (OS) and OS version:
    Mac OS Sonoma 14.3

Local Logs

local logs uploaded here


Security Reminder
Local does a pretty good job of scrubbing private info from the logs and the errors it produces, however there’s always the possibility that something private can come through. Because these are public forums, always review the screenshots you are sharing to make sure there isn’t private info like passwords being displayed.

Hi @coreyallen

Just to clarify are the OS and Local versions the same between machines?

Have you tried a reinstall on the machine that’s been problematic (making sure to save any site files first as backup)?

Keep us posted and we’d be happy to help further!

yes OS and local versions are the same. I did re-install by overwriting the latest version but are you suggesting a full uninstall and reinstall?

Hi @coreyallen

Correct - The steps would look like this:

Keep us posted and we’d be happy to help further!

Thanks! I have about 50 sites in local so exporting each one, one at a time will take some time but I’ll start chipping away at it. I’m actually starting to think it may be an issue with my zsh profile setup but I’m not familiar enough to be able to tell one way or another.

Ah okay in that case it might better to wait. You might be right about the zsh profile setup and I don’t want you to go through all of that trouble for nothing. If you had just a site or two I thought it could be worth a shot.

Thanks
What for what? I dont see anyone else with this issue so not sure if it’s a bug that will be fixed.

I’m still looking into this and either myself or a Local Dev will report back!

Ah sorry I misunderstood. Thanks for looking into it.

@coreyallen Are you opening a site shell via local? If you are then can you output these for us:

which php

echo $PATH

Thanks so much for getting back to me:
yes I’m opening shell via local
which php gives
/opt/homebrew/bin/php
Path give
/Users/corey/.bun/bin:/opt/homebrew/bin:/Users/corey/node_modules/:/Users/corey/node_modules/:/Users/corey/.node/bin:/Users/corey/.npm-packages/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/opt/puppetlabs/bin

So just an update I installed mysql via home-brew and that did the trick for not getting the mysqldump error but still getting the error below

Failed loading /Users/corey/Library/Application Support/Local/lightning-services/php-8.0.22+6/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20200930/opcache.so:  dlopen(/Users/corey/Library/Application Support/Local/lightning-services/php-8.0.22+6/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20200930/opcache.so, 0x0009): symbol not found in flat namespace '__zend_get_parameters_array_ex'
Failed loading /Users/corey/Library/Application Support/Local/lightning-services/php-8.0.22+6/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20200930/xdebug.so:  dlopen(/Users/corey/Library/Application Support/Local/lightning-services/php-8.0.22+6/bin/darwin-arm64/lib/php/extensions/no-debug-non-zts-20200930/xdebug.so, 0x0009): symbol not found in flat namespace '__zend_get_parameters_array_ex'

Hi @coreyallen!

Looks like those PHP issues are due to using the system PHP instead of the PHP binaries we ship with Local. When you open a Site Shell from Local, we modify the $PATH variable to add our binaries. Normally I’d ask you to check your shell configuration (.bashrc or .zshrc) to make sure you’re not overriding our config, but I’m not seeing our binaries in your $PATH at all.

Can you confirm the output you’re seeing when you open a site shell via the “Open site shell” button? It should look something like this:

Setting Local environment variables...
----
WP-CLI:   WP-CLI 2.9.0
Composer: 2.6.2 2023-09-03
PHP:      8.1.23
MySQL:    mysql  Ver 8.0.16 for macos10.14 on x86_64 (MySQL Community Server - GPL)
----
Launching shell: /bin/zsh ...
1 Like

I do see the same problem in php 8.1.x a slightly modified output about loading modules in php 8.2.x and a seemingly fixed method in php8.3.0

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