Varying-Vagrant-Vagrants / VVV

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

Delayed 502 Gateway Error #2062

Closed shanebp closed 4 years ago

shanebp commented 4 years ago

What was The Command Used To Provision

vagrant reload --provision

What Kind of VVV Provision Was This

This was a reprovision of an already working VVV

Logs/What Broke

Provision Log https://gist.github.com/shanebp/4156dcf2a0fe64d0a9bb456e762b1698

Things have been working great for months. I have started and stopped Vagrant many times. But today I had to reboot my laptop... Then I restarted vagrant vagrant up --provision.

Then, I can browse to the localhost dashboard vvv.test and then to a local WordPress site. But I start getting 502 Bad Gateway errors after about 10 seconds.

I've tried starting and stopping vagrant. Also tried destroying the default machine and rebuilding it. The result is always the same, in any browser:
The 502 Bad Gateway error starts appearing after about 10 seconds.

This problem just started. Any suggestions welcomed.


    new-wcvsite:
  # repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
    description: "WC Vendors"
    skip_provisioning: false
    hosts:
      - woowcv.test

  wordpress-default:
  # repo: https://github.com/Varying-Vagrant-Vagrants/vvv-wordpress-default.git
    description: "WP Test - BuddyPress"
    skip_provisioning: false
    hosts:
      - local.wordpress.test

# Utilities are system level items rather than sites, that install tools or packages
# the core utilities install tools such as phpmyadmin
utilities:
  core: # The core VVV utility
    - memcached-admin # Object cache management
    - opcache-status # opcache management
    - phpmyadmin # Web based database client
    - webgrind # PHP Debugging
    - trusted-hosts # GitHub etc
    - tls-ca # SSL/TLS certificates
    #- php56
    #- php70
    #- php71
    #- php72
    #- php73

# vm_config controls how Vagrant provisions the virtual machine, and can be used to
# increase the memory given to VVV and the number of CPU cores. For WP core development
# we recommend at least 2GB ( 2048 )
# It can also be used to override the default provider being used within Vagrant.
# Due to a limitation within Vagrant, the specified provider is only respected on a clean `vagrant up`
# as Vagrant currently restricts you to one provider per machine
# https://www.vagrantup.com/docs/providers/basic_usage.html#vagrant-up
vm_config:
  memory: 2048
  cores: 2
  # provider: vmware_workstation

# General VVV options
general:
  # Backup the databases to the database/backups subfolder on halt/suspend/destroy, set to false to disable
  db_backup: true
  # Import the databases if they're missing from backups
  db_restore: true

Possible Solution

Steps to Reproduce (for bugs)

1. 2. 3. 4.

https://gist.github.com/shanebp/4156dcf2a0fe64d0a9bb456e762b1698

Your Environment

Operating System: Windows 10 64 bit using current versions of Virtual Box and Vagrant

nicksull commented 4 years ago

I'm getting the same error and behaviour on Mac OS Ver 10.15.3 (19D76)

On vagrant provision I'm getting errors with php7.2-fpm.service


    default: Feb 06 07:08:47 vvv update-alternatives[12939]: update-alternatives: error: alternative path /run/php/php7.2-fpm.sock doesn't exist
    default: Feb 06 07:08:47 vvv systemd[1]: php7.2-fpm.service: Can't open PID file /run/php/php7.2-fpm.pid (yet?) after start-post: No such file or directory
    default: Feb 06 07:10:17 vvv systemd[1]: php7.2-fpm.service: Start-post operation timed out. Stopping.
    default: Feb 06 07:10:17 vvv systemd[1]: php7.2-fpm.service: Failed with result 'timeout'.
    default: Feb 06 07:10:17 vvv systemd[1]: Failed to start The PHP 7.2 FastCGI Process Manager.
    default: dpkg: error processing package php7.2-fpm (--configure):```
IronGhost63 commented 4 years ago

same problem here. (on macOS)

I just upgraded vagrant box to latest version as well as VVV. then I got 502 bad gateway after provision.

I checked nginx error log and found this:

2020/02/06 07:23:32 [crit] 13335#13335: *6 connect() to unix:/var/run/php7.2-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 192.168.50.1, server: vvv.test, request: "GET / HTTP/1.1", upstream: "fastcgi://unix:/var/run/php7.2-fpm.sock:", host: "vvv.test"
df-a commented 4 years ago

I am having 502 errors too. It used to work but I haven't used it in quite a while. Today I updated vagrant and virtualbox for the first time since installing MacOS Catalina, I keep getting 502 bad gateway errors on all pages. It doesn't load anything.

Nginx error:

Screen Shot 2020-02-06 at 03 30 50

df-a commented 4 years ago

The PHP provisioner seems to keep ending in errors:

default: Running: /var/folders/tw/4dqr4wxj1n309499f7pssfmh0000gn/T/vagrant-shell20200206-1410-17mbrpm.sh default: Running utility provisioner for 'core/php74' default: E: Sub-process /usr/bin/dpkg returned an error code (1) default: Job for php7.4-fpm.service failed because a timeout was exceeded. default: See "systemctl status php7.4-fpm.service" and "journalctl -xe" for details. default: The 'core/php74' provisioner completed in 236 seconds

tomjn commented 4 years ago

I spent some time debugging this last night:

If anybody has more info let me know, I’ll pick this up again later and see what I can do

IronGhost63 commented 4 years ago
  • I’m not sure why this is happening, master branch hasn’t been touched in a while. I reverted changes to add the PHP-pcov extension but they had no

I tried previous version of both VVV (3.1.1) and Ubuntu box (20190801.1.0) which was working just fine before re-provision. both still affected.

I guess that something happened in PHP ppa?

tomjn commented 4 years ago

So this happens in older versions if your provision a fresh box?

On Thu, 6 Feb 2020 at 10:07, Jirayu notifications@github.com wrote:

  • I’m not sure why this is happening, master branch hasn’t been touched in a while. I reverted changes to add the PHP-pcov extension but they had no

I tried previous version of both VVV (3.1.1) and Ubuntu box (20190801.1.0) which was working just fine before re-provision. both still affected.

I guess that something happened in PHP repo?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/Varying-Vagrant-Vagrants/VVV/issues/2062?email_source=notifications&email_token=AAAOLZYUX77ZN42V2CHULW3RBPOOHA5CNFSM4KQXGXVKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEK6UFJI#issuecomment-582828709, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAOLZZDLNHZ5JGHHWJF2ITRBPOOHANCNFSM4KQXGXVA .

IronGhost63 commented 4 years ago

Yes

andreagrillo commented 4 years ago

Hi there, I have the same issue, any temporary solution please ?

Let me know. Thanks!

Mte90 commented 4 years ago

Looking at https://github.com/phpearth/alpine/issues/2 maybe is the wrong position of the pid file? We changed the bash profile the other week to support better the utilities, maybe that change created the issues?

olipayne commented 4 years ago

Temp fix which worked for me, posted here - https://github.com/Varying-Vagrant-Vagrants/VVV/issues/2061#issuecomment-582952009

janw-me commented 4 years ago

I'm having this error with a newly created box, after a colleague had it with an existing box.

brandenMB commented 4 years ago

+1 - this isn't just Windows, it's happening on Mac as well.

tomjn commented 4 years ago

@Mte90 it's not the bash alias changes as it happens in master too

tomjn commented 4 years ago

I'm going to close this in favour of #2061 as it's the same issue

lock[bot] commented 4 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.