Local Community

Lightning - Open Site Shell not working

Hello. I noticed that the option to Open Site Shell doesn’t seem to be working. There are no error messages presented and nothing in the log that I can see. I check my system logs and don’t see anything there either. Is this feature not yet working?

Kernel: 5.0.0-27-ge-neric x86_64 Desktop: KDE Plasma 5.16.5 Distro: Ubuntu 19.04 (Disco Dingo) System: Dell product: XPS 15 9570

Also, thank you for releasing a version of this for Linux. I can also say you picked an apt name in Lightning. Having used previous versions of Local I can say I am very impressed by the performance of this release. Kudos to the team for a job well done!

Same in macOS Catalina.

~ /<snip>/Local/ssh-entry/NNjTIwajU.sh; exit
-n -e
Setting Local environment variables...
WP-CLI: WP-CLI 2.2.0
PHP:    7.3.5
MySQL:  mysql  Ver 8.0.15 for macos10.14 on x86_64 (MySQL Community Server - GPL)
Launching shell: /bin/zsh ...

And then nothing.

@JJJ I’m still in Mojave but it works here on Local 5.0.5

/<snip>/Local/ssh-entry/PGDT9sMcd.sh ; exit;
➜ macbook: ~ /<snip>/Local/ssh-entry/PGDT9sMcd.sh ; exit;
-n -e
Setting Local environment variables...
WP-CLI: WP-CLI 2.2.0
PHP: 7.3.5
MySQL: mysql Ver 8.0.15 for macos10.14 on x86_64 (MySQL Community Server - GPL)
Launching shell: /bin/zsh ...
➜ macbook: ~/Local_Sites/gitcore/app/public git:(master)

Might be a Catalina issue as the MySQL looks like it’s for Mojave.

Hey, I’ve found a work around!

I reckon that the new version of Local wont send you into a custom VirtualBox container where all your site files reside and all. Instead everything lives on your usual machine. Therefore you connect to your site via the same shell as you normally use – locally. Someone please correct me if I’m wrong or not making any sense.

My issue seemed to be that the path variables that Local tried to set for its own versions of php, mysql and wp-cli gets overridden by my own $PATH extensions in .bash_profile.

My solution was to try to detect if Local is trying to extend path and then reapply it’s settings:

# If Local.app already exists in $PATH reapply it in the front to take precedence over others.
# This must come after your own $PATH extensions in .bash_profile, .zshrc or similar
if [[ $PATH == *"Local.app"* ]]; then
  export PATH="/Applications/Local.app/Contents/Resources/extraResources/site-binaries/mysql-8.0.15/bin:$PATH"
  export PATH="/Applications/Local.app/Contents/Resources/extraResources/site-binaries/php-7.3.5/bin:$PATH"
  export PATH="/Applications/Local.app/Contents/Resources/extraResources/site-binaries/wp-cli/bin:$PATH"

Then I can just run wp as if I was on my site.

Hope this helps!

1 Like

@adambergman you are correct about it using your local shell. I didn’t get that at first. In addition, I switched from bash to zsh when Catalina went beta, which may have contributed to my issues above.

This appears to be working now, though. So perhaps it was part misunderstanding, part moving to zsh and mucking it up originally. Willing to call this user error on my part.

This is happening to me after recently upgrading to Catalina and Local (Lightning). Pasted the proposed workaround described by adambergman in to my .zshrc file - no dice but maybe I’m misunderstanding what’s supposed to happen.

Any advice? This is a huge problem for me :frowning_face:

Took me a few minutes to realize that with lightning, you can access wp cli without it opening a new shell. Open Site Shell opens a new tab in your terminal which should then give you access to WP CLI. However, it looks like there are issues. I’m trying to reset and reinstall a database export but I keep getting this error

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Seems like this might be an issue with Lightning as I’ve read the following in this post Unable to access database

Currently, the wp db commands don’t work with Local. This is a known issue and our team submitted a patch to WP-CLI . The PR has since been merged and is pending release.

In the meantime, @ben.turner’s pointers above should do the trick.

As far as multisite goes, pushing and pulling isn’t supported, but you should still be able to get up-and-running with multisite.

If you create a brand-new site in Local with multisite, does it function? If so, importing using mysql -u root -proot local < database.sql should do the trick. After that, you should be able to run wp search-replace to update the domain in Local.

1 Like