Varying-Vagrant-Vagrants / VVV

An open source Vagrant configuration for developing with WordPress
https://varyingvagrantvagrants.org
MIT License
4.55k stars 849 forks source link

Bug: Windows: vagrant stopped working #2642

Closed shanebp closed 1 year ago

shanebp commented 1 year ago

My vvv browser dashboard opened today, but all sites returned a mysql unable to connect error. I updated VVV, VirtualBox and Vagrant. I did not change my config.yml Now I cannot start Vagrant, any tips appreciated...


c:\Users\sam3d\vvv-local>vagrant up
__ __ __ __
\ V\ V\ V / v3.10.0 Ruby:2.7.6, Path:"c:/Users/sam3d/vvv-local"
 \_/\_/\_/  git::develop(41e7850c)

Platform: mingw32 windows  HasWinAdminPriv  vagrant-goodhosts monochrome-terminal shared_db_folder_disabled
Vagrant: v2.3.3, virtualbox: v6.1.40

Docs:       https://varyingvagrantvagrants.org/
Contribute: https://github.com/varying-vagrant-vagrants/vvv
Dashboard:  http://vvv.test

Bringing machine 'default' up with 'virtualbox' provider...
==> default: [vagrant-goodhosts] - found entry for: 192.168.56.4 vvv.test
==> default: [vagrant-goodhosts] - found entry for: 192.168.56.4 one.wordpress.test
==> default: [vagrant-goodhosts] - found entry for: 192.168.56.4 buddyboss.test
==> default: [vagrant-goodhosts] - found entry for: 192.168.56.4 buddypress.test
==> default: [vagrant-goodhosts] - found entry for: 192.168.56.4 atrium.test
==> default: [vagrant-goodhosts] Checking for host entries
==> default: [vagrant-goodhosts] Finished processing
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.
==> default: Running action triggers after up ...
==> default: Running trigger: VVV Post-Up...
==> default: Trigger run failed
==> default: An error occurred in the underlying SSH library that Vagrant uses.
==> default: The error message is shown below. In many cases, errors from this
==> default: library are caused by ssh-agent issues. Try disabling your SSH
==> default: agent or removing some keys and try again.
==> default:
==> default: If the problem persists, please report a bug to the net-ssh project.
==> default:
==> default: Net::SSH::ConnectionTimeout
tomjn commented 1 year ago

Have you rebooted your machine since you reinstalled virtualbox? Unless you get an error message from virtualbox or vagrant you should not have updated anything other than VVV. Your new issues are likely unconnected to your original.

If you can look through your log folders provisioner logs and find the log from when you first started having database issues that would be best but in the meantime a system restart is most likely to solve your timeout problem. Messing with virtualbox messes with kernel level things that require a reboot even if the installers say you don’t.

Upgrading vagrant and virtualbox are highly unlikely to resolve issues inside a VM that is able to turn on and show browser output.

On Mon, 21 Nov 2022 at 20:40, shanebp @.***> wrote:

My vvv browser dashboard opened today, but all sites returned a mysql unable to connect error. I updated VVV, VirtualBox and Vagrant. Now I cannot start Vagrant, any tips appreciated...

c:\Users\sam3d\vvv-local>vagrant up


\ V\ V\ V / v3.10.0 Ruby:2.7.6, Path:"c:/Users/sam3d/vvv-local" _/_/_/ git::develop(41e7850c)

Platform: mingw32 windows HasWinAdminPriv vagrant-goodhosts monochrome-terminal shared_db_folder_disabled Vagrant: v2.3.3, virtualbox: v6.1.40

Docs: https://varyingvagrantvagrants.org/ Contribute: https://github.com/varying-vagrant-vagrants/vvv Dashboard: http://vvv.test

Bringing machine 'default' up with 'virtualbox' provider... ==> default: [vagrant-goodhosts] - found entry for: 192.168.56.4 vvv.test ==> default: [vagrant-goodhosts] - found entry for: 192.168.56.4 one.wordpress.test ==> default: [vagrant-goodhosts] - found entry for: 192.168.56.4 buddyboss.test ==> default: [vagrant-goodhosts] - found entry for: 192.168.56.4 buddypress.test ==> default: [vagrant-goodhosts] - found entry for: 192.168.56.4 atrium.test ==> default: [vagrant-goodhosts] Checking for host entries ==> default: [vagrant-goodhosts] Finished processing ==> default: Machine already provisioned. Run vagrant provision or use the --provision ==> default: flag to force provisioning. Provisioners marked to run always will still run. ==> default: Running action triggers after up ... ==> default: Running trigger: VVV Post-Up... ==> default: Trigger run failed ==> default: An error occurred in the underlying SSH library that Vagrant uses. ==> default: The error message is shown below. In many cases, errors from this ==> default: library are caused by ssh-agent issues. Try disabling your SSH ==> default: agent or removing some keys and try again. ==> default: ==> default: If the problem persists, please report a bug to the net-ssh project. ==> default: ==> default: Net::SSH::ConnectionTimeout

— Reply to this email directly, view it on GitHub https://github.com/Varying-Vagrant-Vagrants/VVV/issues/2642, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOLZ2FZ46NG4BML6VZSC3WJPM4LANCNFSM6AAAAAASHBIZBU . You are receiving this because you are subscribed to this thread.Message ID: @.***>

shanebp commented 1 year ago

I rebooted and tried vagrant up and got this error:


Bringing machine 'default' up with 'virtualbox' provider...
==> default: Setting the name of the VM: vvv-local_f22e18711e2
The name of your virtual machine couldn't be set because VirtualBox
is reporting another VM with that name already exists. Most of the
time, this is because of an error with VirtualBox not cleaning up
properly. To fix this, verify that no VMs with that name do exist
(by opening the VirtualBox GUI). If they don't, then look at the
folder in the error message from VirtualBox below and remove it
if there isn't any information you need in there.

VirtualBox error:

VBoxManage.exe: error: Could not rename the directory 'C:\Users\sam3d\VirtualBox VMs\ubuntu-20.04-amd64_1669060828560_37737' to 'C:\Users\sam3d\VirtualBox VMs\vvv-local_f22e18711e2' to save the settings file (VERR_ALREADY_EXISTS)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component SessionMachine, interface IMachine, callee IUnknown
VBoxManage.exe: error: Context: "SaveSettings()" at line 3286 of file VBoxManageModifyVM.cpp
tomjn commented 1 year ago

Did you destroy the .vagrant folder or do anything other than updating software? When you say you updated VVV how did you do it?

On Mon, 21 Nov 2022 at 20:54, shanebp @.***> wrote:

I rebooted and tried vagrant up and got this error:

Bringing machine 'default' up with 'virtualbox' provider... ==> default: Setting the name of the VM: vvv-local_f22e18711e2 The name of your virtual machine couldn't be set because VirtualBox is reporting another VM with that name already exists. Most of the time, this is because of an error with VirtualBox not cleaning up properly. To fix this, verify that no VMs with that name do exist (by opening the VirtualBox GUI). If they don't, then look at the folder in the error message from VirtualBox below and remove it if there isn't any information you need in there.

VirtualBox error:

VBoxManage.exe: error: Could not rename the directory 'C:\Users\sam3d\VirtualBox VMs\ubuntu-20.04-amd64_1669060828560_37737' to 'C:\Users\sam3d\VirtualBox VMs\vvv-local_f22e18711e2' to save the settings file (VERR_ALREADY_EXISTS) VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component SessionMachine, interface IMachine, callee IUnknown VBoxManage.exe: error: Context: "SaveSettings()" at line 3286 of file VBoxManageModifyVM.cpp

— Reply to this email directly, view it on GitHub https://github.com/Varying-Vagrant-Vagrants/VVV/issues/2642#issuecomment-1322628309, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOLZ6ZNUVU55VSPZAUWYDWJPORNANCNFSM6AAAAAASHBIZBU . You are receiving this because you commented.Message ID: @.***>

shanebp commented 1 year ago

I updated VVV with a git pull. I did not destroy the .vagrant folder.

tomjn commented 1 year ago

And you’re using the same user to run these actions as before? I don’t know what you’ve done but vagrant no longer sees that you already have a VM. I do not have an answer for you.

You may be forced to destroy your VM manually via Virtualbox. You may be able to save your database by starting it in virtualbox and SSH’ing in manually to do a DB export

On Mon, 21 Nov 2022 at 21:00, shanebp @.***> wrote:

I updated VVV with a git pull. I did not destroy the .vagrant folder.

— Reply to this email directly, view it on GitHub https://github.com/Varying-Vagrant-Vagrants/VVV/issues/2642#issuecomment-1322634138, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOLZ457JKZLREMK4LRZLTWJPPHHANCNFSM6AAAAAASHBIZBU . You are receiving this because you commented.Message ID: @.***>

shanebp commented 1 year ago

Destroyed the VM via their GUI. Ran vagrant up again - now working. Lost the old databases but that's ok - this time. Thanks for your help. Next time I'll ask sooner rather than going ignorant overboard.

btw - I think the original db connection issue was simply a corrupted hosts file - it was missing: 127.0.0.1 localhost

tomjn commented 1 year ago

VirtualBox VMs have their own IP address so it shouldn't matter that localhost was missing, but it wouldn't surprise me if that caused issues elsewhere

shanebp commented 1 year ago

This issue has returned.
I can open the VVV Dashboard. But opening any site gives this browser message:

Connection refused

Error reconnecting to the database
This means that the contact with the database server at localhost was lost. This could mean 
your host’s database server is down.

Are you sure the database server is running?
Are you sure the database server is not under particularly heavy load?
If you are unsure what these terms mean you should probably contact your host. If you still need help 
you can always visit the WordPress Support Forums.

 This message was triggered by WordPress Core.

Call stack:

wp_die()
wp-includes/class-wpdb.php:3673
add_option()
wp-includes/option.php:972
set_transient('doing_cron')
wp-includes/cron.php:884
spawn_cron()
wp-includes/cron.php:994
_wp_cron()
wp-includes/class-wp-hook.php:308
do_action('wp_loaded')
wp-settings.php:639

I then ran vagrant halt and this was the result:

c:\Users\sam3d\vvv-local>vagrant halt
==> default: Running action triggers before halt ...
==> default: Running trigger: VVV Pre-Halt...
==> default: Trigger run failed
==> default: ☺scp: /tmp/vagrant-shell: Read-only file system
==> default:
==> default: Attempting graceful shutdown of VM...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

echo; printf $SSH_AUTH_SOCK

Stdout from the command:

Stderr from the command:

printf: usage: printf [-v var] format [arguments]

And if I try to start it again, this is the result:

c:\Users\sam3d\vvv-local>vagrant up
__ __ __ __
\ V\ V\ V / v3.10.0 Ruby:2.7.6, Path:"c:/Users/sam3d/vvv-local"
 \_/\_/\_/  git::develop(41e7850c)

Platform: mingw32 windows  HasWinAdminPriv  vagrant-goodhosts monochrome-terminal shared_db_folder_disabled
Vagrant: v2.3.3, virtualbox: v6.1.40

Docs:       https://varyingvagrantvagrants.org/
Contribute: https://github.com/varying-vagrant-vagrants/vvv
Dashboard:  http://vvv.test

Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.

If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.

If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
tomjn commented 1 year ago

I need the output of the command that resulted in Connection refused errors happening in the browser. The more things you do after this error occurs the more the error is compounded and the less useful the output is.

E.g. at some point you re-provisioned, it had issues, and those issues were not noticed until you went to the browser. I need those provisioner logs.

btw is this on a spinning mechanical hard drive or a solid state flash drive?

tomjn commented 1 year ago

Even a vagrant up --provision from the current broken state would be more helpful, but everything that came after when the error started is significantly less useful.

Note all this information is logged to the log folder, arranged by time, date, and each provisioner is a separate log file. To my understanding there are no new commands you can run that will reveal what happened. If you don't have the output then unfortunately you may have missed your opportunity to debug the problem

tomjn commented 1 year ago

the other thing this might be, is if you filled your VMs virtual drive with stuff and there is no free space left

shanebp commented 1 year ago

It is a solid state drive - on Windows 10 64 bit. I did not add anything other than basic WP sites to the VM via config yml. I have all the logs from yesterday when things started working again. 2022.11.21_21-08-12.zip

There are no logs for today. I just ran vagrant up --provision - the result:

c:\Users\sam3d\vvv-local>vagrant up --provision
__ __ __ __
\ V\ V\ V / v3.10.0 Ruby:2.7.6, Path:"c:/Users/sam3d/vvv-local"
 \_/\_/\_/  git::develop(41e7850c)

Platform: mingw32 windows  HasWinAdminPriv  vagrant-goodhosts monochrome-terminal shared_db_folder_disabled
Vagrant: v2.3.3, virtualbox: v6.1.40

Docs:       https://varyingvagrantvagrants.org/
Contribute: https://github.com/varying-vagrant-vagrants/vvv
Dashboard:  http://vvv.test

Bringing machine 'default' up with 'virtualbox' provider...
==> default: [vagrant-goodhosts] - found entry for: 192.168.56.4 vvv.test
==> default: [vagrant-goodhosts] - found entry for: 192.168.56.4 one.wordpress.test
==> default: [vagrant-goodhosts] - found entry for: 192.168.56.4 buddyboss.test
==> default: [vagrant-goodhosts] - found entry for: 192.168.56.4 buddypress.test
==> default: [vagrant-goodhosts] - found entry for: 192.168.56.4 atrium.test
==> default: [vagrant-goodhosts] Checking for host entries
==> default: [vagrant-goodhosts] Finished processing
==> default: Running provisioner: file...
Guest-specific operations were attempted on a machine that is not
ready for guest communication. This should not happen and a bug
should be reported.
tomjn commented 1 year ago

And you're sure your machine has enough free space?

So the reproduction steps are:

  1. Install VVV
  2. vagrant up
  3. It works!
  4. vagrant halt
  5. vagrant up ( no --provision )
  6. dashboard works but could not connect to database
  7. all vagrant commands timeout

Is that correct? And be very very specific, include all other commands, e.g. only say yes if there was a single vagrant up, if there were 2 or you turned it on and off several times then that's different. Likewise if you never halted the machine.

I need to know what happened between DB works and DB does not work, even the mundane steps. E.g. is it working then you close the lid on your machine and when you reopen it things are broken, etc. Avoid paraphrasing too.

e.g. when you say this:

I did not add anything other than basic WP sites to the VM via config yml.

Is that the point at which it stops working? You never mentioned reprovisioning to add sites before, or any details of those sites

Focus less on it not working/the end result, and more on the specific changing point when it deviated from working ok. This also means that for now the inability to run vagrant up or vagrant halt is irrelevant, because those happen after the DB connection issues you reported, so focus on what broke first, at the very first time it was broken, and the things that happened immediately before then.

I also see that you said that you updated VirtualBox, yet you're running 6.1.40, not 7.x.

tomjn commented 1 year ago

Also if you end up in the unable to connect to the database situation again, do not try to halt or destroy the VM, instead SSH in and check if the mariadb service is running, and if not, try to start it and report back the output.

Likewise try to connect as the root database user via phpmyadmin. Also note what you'd done in the hour before you first noticed it, and be pendantic about what you list, e.g. as I mentioned before powering down your device or it going to sleep, using other local dev environments, updates, etc

shanebp commented 1 year ago

I only using 66 GBs of my 377 GB c drive.

Everything was working properly yesterday - after provisioning the sites.

This morning I woke my computer, and went to the VVV dashboard and tried to open a site and got the DB connection error. So the only thing between yesterday and this morning was sleep mode.

After seeing the db connection error, I tried and failed to open phpmyadmin via the vvv dashboard.

Re virtualbox - I downloaded the newest windows version which was 6.1.40

tomjn commented 1 year ago

Hmm so vagrant up then sleep then broken, did phoMyAdmin fail to login or did it fail to load entirely?

shanebp commented 1 year ago

It failed to load entirely.

tomjn commented 1 year ago

With an error or a timeout?

On Tue, 22 Nov 2022 at 17:30, shanebp @.***> wrote:

It failed to load entirely.

— Reply to this email directly, view it on GitHub https://github.com/Varying-Vagrant-Vagrants/VVV/issues/2642#issuecomment-1324021336, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOLZYBNYXD67MQWWBQG3LWJT7NDANCNFSM6AAAAAASHBIZBU . You are receiving this because you commented.Message ID: @.***>

shanebp commented 1 year ago

With an error - which I did not copy. But the text was red.

tomjn commented 1 year ago

If you start up a VVV in a separate folder do you think sleeping and resuming would trigger this again?

On Tue, 22 Nov 2022 at 17:33, shanebp @.***> wrote:

With an error - which I did not copy. But the text was red.

— Reply to this email directly, view it on GitHub https://github.com/Varying-Vagrant-Vagrants/VVV/issues/2642#issuecomment-1324023580, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOLZYOEA3OBAUHJUZJYM3WJT7UXANCNFSM6AAAAAASHBIZBU . You are receiving this because you commented.Message ID: @.***>

shanebp commented 1 year ago

I have no idea.
Are you saying install VVV in a folder other than vvv-local ?

tomjn commented 1 year ago

yes, just to test without messing with your main install, not necessarily because of the folder.

Some questions:

After checking these, I'd also suggest updating to VirtualBox 7 and doing a system restart, the current latest is 7.0.4:

https://download.virtualbox.org/virtualbox/7.0.4/VirtualBox-7.0.4-154605-Win.exe

shanebp commented 1 year ago

I installed VVV in a new dir and everything worked. I shut it down and restarted my computer - and everything worked in the new dir.

c:\Users\sam3d\vvv-new>vagrant plugin list --local
vagrant-goodhosts (1.1.4, local)

c:\Users\sam3d\vvv-new>vagrant box list
bento/ubuntu-20.04 (virtualbox, 202206.03.0)
shanebp commented 1 year ago

Updated Virtualbox and vagrant upworked on the new VVV dir. Everything is working... fingers crossed. thanks again for your help.

shanebp commented 1 year ago

This issue is back. It worked for weveral days. Ihave not touched anything re command line or config files, etc. The dashboard loads, but opening any site gives this:

Warning: mysqli_real_connect(): (HY000/2002): Connection refused
 in /srv/www/wordpress-one/public_html/wp-includes/class-wpdb.php 
on line 1775
Connection refused
Error establishing a database connection
 This message was triggered by WordPress Core.

Call stack:

wp_die()

wp-includes/functions.php:5318
dead_db()
wp-includes/class-wpdb.php:2009
add_option()
wp-includes/option.php:972
set_transient('doing_cron')
wp-includes/cron.php:884
spawn_cron()
wp-includes/cron.php:994
_wp_cron()
wp-includes/class-wp-hook.php:308
do_action('wp_loaded')
wp-settings.php:639

And opening phpmyadmin gives this:

phpMyAdmin - Error
Error during session start; please check your PHP and/or webserver log file 
and configure your PHP installation properly. Also ensure that 
cookies are enabled in your browser.
session_start(): open(SESSION_FILE, O_RDWR) failed: Read-only file system (30)
session_start(): Failed to read session data: files (path: /var/lib/php/sessions)
tomjn commented 1 year ago

Can you SSH into the VM and check the Maria DB service status and try to start it?

On Mon, 28 Nov 2022 at 19:57, shanebp @.***> wrote:

This issue is back. It worked for weveral days. Ihave not touched anything re command line. The dashboard loads, but opening any site gives this:

Error establishing a database connection This message was triggered by WordPress Core.

Call stack:

wp_die()

wp-includes/functions.php:5318 dead_db() wp-includes/class-wpdb.php:2009 add_option() wp-includes/option.php:972 set_transient('doing_cron') wp-includes/cron.php:884 spawn_cron() wp-includes/cron.php:994 _wp_cron() wp-includes/class-wp-hook.php:308 do_action('wp_loaded') wp-settings.php:639

And opening phpmyadmin gives this:

phpMyAdmin - Error Error during session start; please check your PHP and/or webserver log file and configure your PHP installation properly. Also ensure that cookies are enabled in your browser. session_start(): open(SESSION_FILE, O_RDWR) failed: Read-only file system (30) session_start(): Failed to read session data: files (path: /var/lib/php/sessions)

— Reply to this email directly, view it on GitHub https://github.com/Varying-Vagrant-Vagrants/VVV/issues/2642#issuecomment-1329679218, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOLZ63PAPTQ56XD5OUOZ3WKUFAZANCNFSM6AAAAAASHBIZBU . You are receiving this because you commented.Message ID: @.***>

tomjn commented 1 year ago

That might give clues as to what’s happening inside the VM but it doesn’t say much about the VM otherwise or explain why sleep breaks your VM. It may be that this problem is unsolvable from the VVV side and requires a fix deeper down the stack in the VirtualBox side of things

shanebp commented 1 year ago

Can you SSH into the VM and check the Maria DB service status

Sorry to ask, but how do I do this from the command liine?

tomjn commented 1 year ago

I’m on my phone so I can’t give you exact commands

Something similar to sudo service MariaDB status, it should be super googleable as it’s an Ubuntu VM

On Mon, 28 Nov 2022 at 21:05, shanebp @.***> wrote:

Does this help:

c:\Users\sam3d\vvv-new>vagrant ssh

✧ Hello Again! ✧         ✧            ✧

✧ ▄▀▀▀▄▄▄▄▄▄▄▀▀▀▄ ✧

✧█▒▒░░░░░░░░░▒▒█ \ V\ V\ V /

▄▄ █░░█░░░░░█░░█ ✧ _/_/_/

█░░█ █░░░▀█▀░░░█ ✧ ✧

█░░█ ▀▄░░░░░░░▄▀ ✧ Have a nice day :)

This system is built by the Bento project by Chef Software

More information can be found at https://github.com/chef/bento

@.***:~$ # systemctl status mariadb

@.***:~$ systemd status mariadb

Excess arguments.

@.***:~$ mysql

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)

— Reply to this email directly, view it on GitHub https://github.com/Varying-Vagrant-Vagrants/VVV/issues/2642#issuecomment-1329759834, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOLZ4KGPBZCWZ3L3ZKRU3WKUM7ZANCNFSM6AAAAAASHBIZBU . You are receiving this because you commented.Message ID: @.***>

shanebp commented 1 year ago

Thanks -result Unit MariaDB.service could not be found.


ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
vagrant@vvv:~$ sudo service MariaDB status
Unit MariaDB.service could not be found.``
tomjn commented 1 year ago

It might have another name I don’t remember the specific service name

On Mon, 28 Nov 2022 at 21:10, shanebp @.***> wrote:

Thanks -result `Unit MariaDB.service could not be found.``

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111) @.***:~$ sudo service MariaDB status Unit MariaDB.service could not be found.``

— Reply to this email directly, view it on GitHub https://github.com/Varying-Vagrant-Vagrants/VVV/issues/2642#issuecomment-1329766836, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOLZ2VLOU54EMXFM5LSPTWKUNSTANCNFSM6AAAAAASHBIZBU . You are receiving this because you commented.Message ID: @.***>

shanebp commented 1 year ago

Got this using mysql instead of mariadb:


``vagrant@vvv:~$ sudo service mysql status
● mariadb.service - MariaDB 10.5.18 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/mariadb.service.d
             └─migrated-from-my.cnf-settings.conf
     Active: failed (Result: exit-code) since Mon 2022-11-28 19:44:58 UTC; 1h 27min ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 20980 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
    Process: 20984 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 20995 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/gal>
    Process: 21063 ExecStart=/usr/sbin/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, statu>
   Main PID: 21063 (code=exited, status=1/FAILURE)
     Status: "MariaDB server is down"

Nov 28 19:44:58 vvv mariadbd[21063]: 2022-11-28 19:44:58 0 [ERROR] Plugin 'Aria' init function returned error.
Nov 28 19:44:58 vvv mariadbd[21063]: 2022-11-28 19:44:58 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed.
Nov 28 19:44:58 vvv mariadbd[21063]: 2022-11-28 19:44:58 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be wr>
Nov 28 19:44:58 vvv mariadbd[21063]: 2022-11-28 19:44:58 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be wr>
Nov 28 19:44:58 vvv mariadbd[21063]: 2022-11-28 19:44:58 0 [ERROR] Plugin 'InnoDB' init function returned error.
Nov 28 19:44:58 vvv mariadbd[21063]: 2022-11-28 19:44:58 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
Nov 28 19:44:58 vvv mariadbd[21063]: 2022-11-28 19:44:58 0 [Note] Plugin 'FEEDBACK' is disabled.
Nov 28 19:44:58 vvv mariadbd[21063]: 2022-11-28 19:44:58 0 [ERROR] Could not open mysql.plugin table: "Unknown storage engi>
Nov 28 19:44:58 vvv mariadbd[21063]: 2022-11-28 19:44:58 0 [ERROR] Failed to initialize plugins.
Nov 28 19:44:58 vvv mariadbd[21063]: 2022-11-28 19:44:58 0 [ERROR] Aborting```
tomjn commented 1 year ago

If you replace status with start what happens

On Mon, 28 Nov 2022 at 21:13, shanebp @.***> wrote:

Got this using mysql instead of mariadb:

@.***:~$ sudo service mysql status ● mariadb.service - MariaDB 10.5.18 database server Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled) Drop-In: /etc/systemd/system/mariadb.service.d └─migrated-from-my.cnf-settings.conf Active: failed (Result: exit-code) since Mon 2022-11-28 19:44:58 UTC; 1h 27min ago Docs: man:mariadbd(8) https://mariadb.com/kb/en/library/systemd/ Process: 20980 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS) Process: 20984 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS) Process: 20995 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=`cd /usr/bin/..; /usr/bin/gal> Process: 21063 ExecStart=/usr/sbin/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, statu> Main PID: 21063 (code=exited, status=1/FAILURE) Status: "MariaDB server is down"

Nov 28 19:44:58 vvv mariadbd[21063]: 2022-11-28 19:44:58 0 [ERROR] Plugin 'Aria' init function returned error. Nov 28 19:44:58 vvv mariadbd[21063]: 2022-11-28 19:44:58 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE failed. Nov 28 19:44:58 vvv mariadbd[21063]: 2022-11-28 19:44:58 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be wr> Nov 28 19:44:58 vvv mariadbd[21063]: 2022-11-28 19:44:58 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must be wr> Nov 28 19:44:58 vvv mariadbd[21063]: 2022-11-28 19:44:58 0 [ERROR] Plugin 'InnoDB' init function returned error. Nov 28 19:44:58 vvv mariadbd[21063]: 2022-11-28 19:44:58 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. Nov 28 19:44:58 vvv mariadbd[21063]: 2022-11-28 19:44:58 0 [Note] Plugin 'FEEDBACK' is disabled. Nov 28 19:44:58 vvv mariadbd[21063]: 2022-11-28 19:44:58 0 [ERROR] Could not open mysql.plugin table: "Unknown storage engi> Nov 28 19:44:58 vvv mariadbd[21063]: 2022-11-28 19:44:58 0 [ERROR] Failed to initialize plugins. Nov 28 19:44:58 vvv mariadbd[21063]: 2022-11-28 19:44:58 0 [ERROR] Aborting```

https://camo.githubusercontent.com/660371578c4b5db6ea6c86d3f4c67756e82e91a053ef7b29c23f37428860e59d/687474703a2f2f6d6172696164622e636f6d61736b6d6f6e74792d6c6f676f2e706e67 http:///kb/static/images/favicons/favicon-16x16.5801f8f0f34e.png MariaDB KnowledgeBase systemd https://mariadb.com/kb/en/systemd/ How systemd is configured on MariaDB packages and how to alter its configuration.

— Reply to this email directly, view it on GitHub https://github.com/Varying-Vagrant-Vagrants/VVV/issues/2642#issuecomment-1329771021, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOLZ776F5QCQVHSVYWJ6LWKUOA5ANCNFSM6AAAAAASHBIZBU . You are receiving this because you commented.Message ID: @.***>

shanebp commented 1 year ago

with 'start':

vagrant@vvv:~$ sudo service mysql start
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
vagrant@vvv:~$ journalctl -xe
Nov 28 21:33:10 vvv mariadbd[21992]: 2022-11-28 21:33:10 0 [Warning] Can't create test file /var/lib/mysql/vvv.lower-te>
Nov 28 21:33:10 vvv mariadbd[21992]: /usr/sbin/mariadbd: Can't create file '/var/log/mysql/error.log' (errno: 30 "Read->
Nov 28 21:33:10 vvv mariadbd[21992]: 2022-11-28 21:33:10 0 [ERROR] mariadbd: File '/var/lib/mysql/aria_log_control' not>
Nov 28 21:33:10 vvv mariadbd[21992]: 2022-11-28 21:33:10 0 [ERROR] mariadbd: Got error 'Can't open file' when trying to>
Nov 28 21:33:10 vvv mariadbd[21992]: 2022-11-28 21:33:10 0 [ERROR] Plugin 'Aria' init function returned error.
Nov 28 21:33:10 vvv mariadbd[21992]: 2022-11-28 21:33:10 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE faile>
Nov 28 21:33:10 vvv mariadbd[21992]: 2022-11-28 21:33:10 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must b>
Nov 28 21:33:10 vvv mariadbd[21992]: 2022-11-28 21:33:10 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must b>
Nov 28 21:33:10 vvv mariadbd[21992]: 2022-11-28 21:33:10 0 [ERROR] Plugin 'InnoDB' init function returned error.
Nov 28 21:33:10 vvv mariadbd[21992]: 2022-11-28 21:33:10 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE fai>
Nov 28 21:33:10 vvv mariadbd[21992]: 2022-11-28 21:33:10 0 [Note] Plugin 'FEEDBACK' is disabled.
Nov 28 21:33:10 vvv mariadbd[21992]: 2022-11-28 21:33:10 0 [ERROR] Could not open mysql.plugin table: "Unknown storage >
Nov 28 21:33:10 vvv mariadbd[21992]: 2022-11-28 21:33:10 0 [ERROR] Failed to initialize plugins.
Nov 28 21:33:10 vvv mariadbd[21992]: 2022-11-28 21:33:10 0 [ERROR] Aborting
Nov 28 21:36:20 vvv mariadbd[22475]: 2022-11-28 21:36:20 0 [Note] /usr/sbin/mariadbd (mysqld 10.5.18-MariaDB-1:10.5.18+>
Nov 28 21:36:20 vvv mariadbd[22475]: 2022-11-28 21:36:20 0 [Warning] Can't create test file /var/lib/mysql/vvv.lower-te>
Nov 28 21:36:20 vvv mariadbd[22475]: /usr/sbin/mariadbd: Can't create file '/var/log/mysql/error.log' (errno: 30 "Read->
Nov 28 21:36:20 vvv mariadbd[22475]: 2022-11-28 21:36:20 0 [ERROR] mariadbd: File '/var/lib/mysql/aria_log_control' not>
Nov 28 21:36:20 vvv mariadbd[22475]: 2022-11-28 21:36:20 0 [ERROR] mariadbd: Got error 'Can't open file' when trying to>
Nov 28 21:36:20 vvv mariadbd[22475]: 2022-11-28 21:36:20 0 [ERROR] Plugin 'Aria' init function returned error.
Nov 28 21:36:20 vvv mariadbd[22475]: 2022-11-28 21:36:20 0 [ERROR] Plugin 'Aria' registration as a STORAGE ENGINE faile>
Nov 28 21:36:20 vvv mariadbd[22475]: 2022-11-28 21:36:20 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must b>
Nov 28 21:36:20 vvv mariadbd[22475]: 2022-11-28 21:36:20 0 [ERROR] InnoDB: The innodb_system data file 'ibdata1' must b>
Nov 28 21:36:20 vvv mariadbd[22475]: 2022-11-28 21:36:20 0 [ERROR] Plugin 'InnoDB' init function returned error.
Nov 28 21:36:20 vvv mariadbd[22475]: 2022-11-28 21:36:20 0 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE fai>
Nov 28 21:36:20 vvv mariadbd[22475]: 2022-11-28 21:36:20 0 [Note] Plugin 'FEEDBACK' is disabled.
Nov 28 21:36:20 vvv mariadbd[22475]: 2022-11-28 21:36:20 0 [ERROR] Could not open mysql.plugin table: "Unknown storage >
Nov 28 21:36:20 vvv mariadbd[22475]: 2022-11-28 21:36:20 0 [ERROR] Failed to initialize plugins.
Nov 28 21:36:20 vvv mariadbd[22475]: 2022-11-28 21:36:20 0 [ERROR] Aborting
tomjn commented 1 year ago

There's not a lot that can be done with what we have here, the main suggestion I have right now is to switch to a provider that isn't VirtualBox, such as Hyper-V.

At the moment there is no change to VVV I can make that will magically fix this for you, and it's unlikely Vagrant itself could be changed to fix this. The problem is in the VirtualBox layer or deeper. It could even be specific to your hardware and the set of drivers installed on your machine.

I don't know why VirtualBox is doing this, possibly there is something else on your system that prevents it running or interferes with it but I couldn't possibly guess what it is or why. You could try exploring using NFS based filesystem shares, but that would mean forking VVV and you'd be on your own.

Things to note:

The perplexing thing is that it fails to run no matter what once the issue happens according to your report, and when it does happen the filesystem is still accessible in a way that lets PHP run and execute, but anything more complex such as a database engine fails.

One thing I haven't seen from you, is if starting the VM from the VirtualBox interface succeeds in starting the VM. This won't give you sites, but it would mean you could log in to a shell environment via the VirtualBox UI, maybe see if there are error messages on boot. Note that if you do this, do not expect the VVV dashboard or any vagrant commands to work or suddenly become functional.

The very last thing to look into, is VirtualBox Hardening troubleshooting:

https://forums.virtualbox.org/viewtopic.php?f=25&t=82106

It may well be that Antivirus or poorly written software is trying to inject code and the interaction is going badly. If this is the case for you, let me know ASAP. One other person had a similar issue to you in Slack and found that updating to VirtualBox 7 fixed it for them and they were never seen from again.

shanebp commented 1 year ago

If my laptop goes to sleep, the VM powers down. So now when I wake up the laptop, I use the VirtualBox UI to start the the VM in headless state and then do 'vagrant up' - works every time without issues.