Nginx 404 on dev environment

Hi,

whatever happened since i last did a vagrant up but i’m getting a 404 now from nginx on my local dev environment.

I know that this might be a bit too few information to help but the thing is i’m a bit clueless about how to start debugging here. I’ve already checked group_vars files and couldn’t find any error.

Ideas about where i could look at?

Thanks,
Frank

I somehow had two ansible VMs existing for only one test repo and that seem to have caused some problems. I just destroyed them and starting provisioning again.

No problem so far as there was nothing especially valuable in there for the moment. In the future i may have to look a bit closer if the problem reappears.

well looks like there must be some misconfiguration caused by me - provisioning a new one didn’t help.

Here’s the error that vagrant up spits out:

TASK: [wordpress-install | Install WP] **************************************** 
failed: [default] => (item={'key': 'wpdemo.dev', 'value': {'site_install': True, 'admin_user': 'admin', 'local_path': '../site', 'admin_email': 'admin@example.dev', 'system_cron': True, 'cache': {'duration': '30s', 'enabled': False}, 'repo': 'git@github.com:someuser/wpdemo.git', 'ssl': {'enabled': False}, 'multisite': {'enabled': False, 'subdomains': False}, 'site_title': 'wpdemo', 'admin_password': 'admin', 'env': {'db_name': 'wpdemo_dev', 'wp_env': 'development', 'db_user': 'wpdemo_dbuser', 'db_password': 'wpdemo_dbpassword', 'wp_home': 'http://wpdemo.dev', 'wp_siteurl': 'http://wpdemo.dev/wp'}, 'branch': 'master', 'site_hosts': ['wpdemo.dev']}}) => {"changed": true, "cmd": ["wp", "core", "install", "--allow-root", "--url=http://wpdemo.dev", "--title=wpdemo", "--admin_user=admin", "--admin_password=admin", "--admin_email=admin@example.dev"], "delta": "0:00:00.298603", "end": "2015-09-27 09:45:30.031366", "item": {"key": "wpdemo.dev", "value": {"admin_email": "admin@example.dev", "admin_password": "admin", "admin_user": "admin", "branch": "master", "cache": {"duration": "30s", "enabled": false}, "env": {"db_name": "wpdemo_dev", "db_password": "wpdemo_dbpassword", "db_user": "wpdemo_dbuser", "wp_env": "development", "wp_home": "http://wpdemo.dev", "wp_siteurl": "http://wpdemo.dev/wp"}, "local_path": "../site", "multisite": {"enabled": false, "subdomains": false}, "repo": "git@github.com:Helmi/wpdemo.git", "site_hosts": ["wpdemo.dev"], "site_install": true, "site_title": "wpdemo", "ssl": {"enabled": false}, "system_cron": true}}, "rc": 1, "start": "2015-09-27 09:45:29.732763", "stdout_lines": [], "warnings": []}
stderr: PHP Warning:  mysqli_real_connect(): (HY000/2002): No such file or directory in /srv/www/wpdemo.dev/current/web/wp/wp-includes/wp-db.php on line 1452
Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /srv/www/wpdemo.dev/current/web/wp/wp-includes/wp-db.php on line 1452
PHP Deprecated:  mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /srv/www/wpdemo.dev/current/web/wp/wp-includes/wp-db.php on line 1482
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /srv/www/wpdemo.dev/current/web/wp/wp-includes/wp-db.php on line 1482
PHP Warning:  mysql_connect(): No such file or directory in /srv/www/wpdemo.dev/current/web/wp/wp-includes/wp-db.php on line 1482
Warning: mysql_connect(): No such file or directory in /srv/www/wpdemo.dev/current/web/wp/wp-includes/wp-db.php on line 1482
Error: 
<h1>Error establishing a database connection</h1>
<p>This either means that the username and password information in your <code>wp-config.php</code> file is incorrect or we can't contact the database server at <code>localhost</code>. This could mean your host's database server is down.</p>
<ul>
	<li>Are you sure you have the correct username and password?</li>
	<li>Are you sure that you have typed the correct hostname?</li>
	<li>Are you sure that the database server is running?</li>
</ul>
<p>If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the <a href='https://wordpress.org/support/'>WordPress Support Forums</a>.</p>

FATAL: all hosts have already failed -- aborting

I’ve removed/changed some stuff for anonymization.

Any ideas?

ok found it - don’t know why but mysql was set to remote in group_vars/all/database.yml which caused vagrant to not install the mysql packages.

1 Like