WordPress / meta-environment

A collection of scripts that provision the official WordPress.org websites into a Varying Vagrant Vagrants installation.
191 stars 69 forks source link

Access denied for user 'wp'@'localhost' to database 'wordpressorg_dev' #162

Closed juanmaguitar closed 3 years ago

juanmaguitar commented 3 years ago

Hi, I'm having issues when provisioning VVV with meta environments active It seems like some DB's are not being properly created

These are the DB's that are being created

vagrant@vvv:~$ mysql --user="root" --password="root" -e 'show databases'
+-----------------------+
| Database              |
+-----------------------+
| buddypressorg_dev     |
| information_schema    |
| jobs_wordpressnet_dev |
| mysql                 |
| performance_schema    |
| wordpress-one         |
| wordpress-two         |
| wordpress_unit_tests  |
+-----------------------+

The DB's that seem to be missing are:

Full log related to DB's

==> default: Running provisioner: site-wordpress-meta-environment (shell)...
    default: Running: /var/folders/zh/c0rwtffn1dq_nzr1fp8gz1zh0000gn/T/vagrant-shell20211019-24150-p7m0xo.sh
    default:  ▷ Running the 'site-wordpress-meta-environment' provisioner...
    default:  * Pulling down the master branch of https://github.com/WordPress/meta-environment.git
    default: From https://github.com/WordPress/meta-environment
    default:  * branch            master     -> FETCH_HEAD
    default: From git://meta.git.wordpress.org
    default:  * branch                master     -> FETCH_HEAD
    default: From git://meta.git.wordpress.org
    default:  * branch                master     -> FETCH_HEAD
    default: Warning: fopen(/srv/www/wordpress-meta-environment/meta-repository/jobs.wordpress.net/public_html/wp-content/plugins/akismet/class.akismet-cli.php): failed to open stream: No such file or directory in /srv/www/wordpress-meta-environment/meta-repository/jobs.wordpress.net/public_html/wordpress/wp-includes/functions.php on line 6516
    default: Warning: fopen(/srv/www/wordpress-meta-environment/meta-repository/jobs.wordpress.net/public_html/wp-content/plugins/akismet/class.akismet.php): failed to open stream: No such file or directory in /srv/www/wordpress-meta-environment/meta-repository/jobs.wordpress.net/public_html/wordpress/wp-includes/functions.php on line 6516
    default: Warning: fopen(/srv/www/wordpress-meta-environment/meta-repository/jobs.wordpress.net/public_html/wp-content/plugins/akismet/index.php): failed to open stream: No such file or directory in /srv/www/wordpress-meta-environment/meta-repository/jobs.wordpress.net/public_html/wordpress/wp-includes/functions.php on line 6516
    default: Warning: fopen(/srv/www/wordpress-meta-environment/meta-repository/jobs.wordpress.net/public_html/wp-content/plugins/akismet/class.akismet-widget.php): failed to open stream: No such file or directory in /srv/www/wordpress-meta-environment/meta-repository/jobs.wordpress.net/public_html/wordpress/wp-includes/functions.php on line 6516
    default: Warning: fopen(/srv/www/wordpress-meta-environment/meta-repository/jobs.wordpress.net/public_html/wp-content/plugins/akismet/class.akismet-admin.php): failed to open stream: No such file or directory in /srv/www/wordpress-meta-environment/meta-repository/jobs.wordpress.net/public_html/wordpress/wp-includes/functions.php on line 6516
    default: Warning: fopen(/srv/www/wordpress-meta-environment/meta-repository/jobs.wordpress.net/public_html/wp-content/plugins/akismet/class.akismet-rest-api.php): failed to open stream: No such file or directory in /srv/www/wordpress-meta-environment/meta-repository/jobs.wordpress.net/public_html/wordpress/wp-includes/functions.php on line 6516
    default: Warning: fopen(/srv/www/wordpress-meta-environment/meta-repository/jobs.wordpress.net/public_html/wp-content/plugins/akismet/wrapper.php): failed to open stream: No such file or directory in /srv/www/wordpress-meta-environment/meta-repository/jobs.wordpress.net/public_html/wordpress/wp-includes/functions.php on line 6516
    default: Warning: fopen(/srv/www/wordpress-meta-environment/meta-repository/jobs.wordpress.net/public_html/wp-content/plugins/akismet/akismet.php): failed to open stream: No such file or directory in /srv/www/wordpress-meta-environment/meta-repository/jobs.wordpress.net/public_html/wordpress/wp-includes/functions.php on line 6516
    default: From git://meta.git.wordpress.org
    default:  * branch                master     -> FETCH_HEAD
    default: Error: `Access denied for user 'wp'@'localhost' to database 'wordcamp_dev'`
    default: Can’t select database
    default: We were able to connect to the database server (which means your username and password is okay) but not able to select the `wordcamp_dev` database.
    default:
    default: Are you sure it exists?
    default: Does the user `wp` have permission to use the `wordcamp_dev` database?
    default: On some systems the name of your database is prefixed with your username, so it would be like `username_wordcamp_dev`. Could that be the problem?
    default:
    default: If you don’t know how to set up a database you should contact your host. If all else fails you may find help at the WordPress Support Forums. `Access denied for user 'wp'@'localhost' to database 'wordcamp_dev'`
    default: Error: `Access denied for user 'wp'@'localhost' to database 'wordcamp_dev'`
    default: Can’t select database
    default: We were able to connect to the database server (which means your username and password is okay) but not able to select the `wordcamp_dev` database.
    default:
    default: Are you sure it exists?
    default: Does the user `wp` have permission to use the `wordcamp_dev` database?
    default: On some systems the name of your database is prefixed with your username, so it would be like `username_wordcamp_dev`. Could that be the problem?
    default:
    default: If you don’t know how to set up a database you should contact your host. If all else fails you may find help at the WordPress Support Forums. `Access denied for user 'wp'@'localhost' to database 'wordcamp_dev'`
    default: Error: `Access denied for user 'wp'@'localhost' to database 'wordcamp_dev'`
    default: Can’t select database
    default: We were able to connect to the database server (which means your username and password is okay) but not able to select the `wordcamp_dev` database.
    default:
    default: Are you sure it exists?
    default: Does the user `wp` have permission to use the `wordcamp_dev` database?
    default: On some systems the name of your database is prefixed with your username, so it would be like `username_wordcamp_dev`. Could that be the problem?
    default:
    default: If you don’t know how to set up a database you should contact your host. If all else fails you may find help at the WordPress Support Forums. `Access denied for user 'wp'@'localhost' to database 'wordcamp_dev'`
    default: From https://github.com/Automattic/camptix
    default:  * branch            master     -> FETCH_HEAD
    default: From git://meta.git.wordpress.org
    default:  * branch                master     -> FETCH_HEAD
    default: Error: `Access denied for user 'wp'@'localhost' to database 'wordpressorg_dev'`
    default: Can’t select database
    default: We were able to connect to the database server (which means your username and password is okay) but not able to select the `wordpressorg_dev` database.
    default:
    default: Are you sure it exists?
    default: Does the user `wp` have permission to use the `wordpressorg_dev` database?
    default: On some systems the name of your database is prefixed with your username, so it would be like `username_wordpressorg_dev`. Could that be the problem?
    default:
    default: If you don’t know how to set up a database you should contact your host. If all else fails you may find help at the WordPress Support Forums. `Access denied for user 'wp'@'localhost' to database 'wordpressorg_dev'`
    default: Error: `Access denied for user 'wp'@'localhost' to database 'wordpressorg_dev'`
    default: Can’t select database
    default: We were able to connect to the database server (which means your username and password is okay) but not able to select the `wordpressorg_dev` database.
    default:
    default: Are you sure it exists?
    default: Does the user `wp` have permission to use the `wordpressorg_dev` database?
    default: On some systems the name of your database is prefixed with your username, so it would be like `username_wordpressorg_dev`. Could that be the problem?
    default:
    default: If you don’t know how to set up a database you should contact your host. If all else fails you may find help at the WordPress Support Forums. `Access denied for user 'wp'@'localhost' to database 'wordpressorg_dev'`
    default: Error: `Access denied for user 'wp'@'localhost' to database 'wordpressorg_dev'`
    default: Can’t select database
    default: We were able to connect to the database server (which means your username and password is okay) but not able to select the `wordpressorg_dev` database.
    default:
    default: Are you sure it exists?
    default: Does the user `wp` have permission to use the `wordpressorg_dev` database?
    default: On some systems the name of your database is prefixed with your username, so it would be like `username_wordpressorg_dev`. Could that be the problem?
    default:
    default: If you don’t know how to set up a database you should contact your host. If all else fails you may find help at the WordPress Support Forums. `Access denied for user 'wp'@'localhost' to database 'wordpressorg_dev'`
    default: Failed to restart cavalcade-wordpressorg.service: Unit cavalcade-wordpressorg.service not found.
    default: From git://meta.git.wordpress.org
    default:  * branch                master     -> FETCH_HEAD
    default: Error: `Access denied for user 'wp'@'localhost' to database 'wordpresstv_dev'`
    default: Can’t select database
    default: We were able to connect to the database server (which means your username and password is okay) but not able to select the `wordpresstv_dev` database.
    default:
    default: Are you sure it exists?
    default: Does the user `wp` have permission to use the `wordpresstv_dev` database?
    default: On some systems the name of your database is prefixed with your username, so it would be like `username_wordpresstv_dev`. Could that be the problem?
    default:
    default: If you don’t know how to set up a database you should contact your host. If all else fails you may find help at the WordPress Support Forums. `Access denied for user 'wp'@'localhost' to database 'wordpresstv_dev'`
    default: Error: `Access denied for user 'wp'@'localhost' to database 'wordpresstv_dev'`
    default: Can’t select database
    default: We were able to connect to the database server (which means your username and password is okay) but not able to select the `wordpresstv_dev` database.
    default:
    default: Are you sure it exists?
    default: Does the user `wp` have permission to use the `wordpresstv_dev` database?
    default: On some systems the name of your database is prefixed with your username, so it would be like `username_wordpresstv_dev`. Could that be the problem?
    default:
    default: If you don’t know how to set up a database you should contact your host. If all else fails you may find help at the WordPress Support Forums. `Access denied for user 'wp'@'localhost' to database 'wordpresstv_dev'`
    default:  * sourcing of vvv-init.sh reported success
    default:  * VVV is adding an Nginx config from /srv/www/wordpress-meta-environment/provision/vvv-nginx.conf
    default:  * Reloading Nginx
    default:  ✔ The 'site-wordpress-meta-environment' provisioner completed in 113 seconds.
juanmaguitar commented 3 years ago

For context, this is my current config.yml

---

# This file is a YAML formatted file. YAML indenting is done in spaces not
# tabs, and whitespace is significant. If you don't stick to this, it will
# fail on provision

#
# IMPORTANT, if you change this file, you have to reprovision,  no exceptions
# Do this by running either this command:
# vagrant reload --provision

# Or, if your machine is already turned on:
# vagrant provision
#

# These are your websites, and their names map on to the folders they're
# located in. See the docs for how to define these, and what all the keys
# and options are
sites:

  # latest version of WordPress, can be used for client work and testing
  # Check the readme at https://github.com/Varying-Vagrant-Vagrants/custom-site-template
  wordpress-one:
    skip_provisioning: false
    description: "A standard WP install, useful for building plugins, testing things, etc"
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
    hosts:
      - one.wordpress.test
    custom:
      wpconfig_constants:
        WP_DEBUG: true
        WP_DEBUG_LOG: true
        WP_DISABLE_FATAL_ERROR_HANDLER: true # To disable in WP 5.2 the FER mode

  wordpress-two:
    skip_provisioning: false
    description: "A standard WP install, useful for building plugins, testing things, etc"
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
    custom:
      # locale: it_IT
      delete_default_plugins: true
      install_plugins:
        - query-monitor
    hosts:
      - two.wordpress.test

  # The following commented out site configuration will create a standard WordPress
  # site in www/example-site/ available at http://mysite.test.
  # Remember, whitespace is significant! Tabs and spaces mean different things
  #mysite:
  #  description: "My website"
  #  repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
  #  hosts:
  #    - mysite.test

  # The wordpress-develop configuration is useful for contributing to WordPress Core.
  # It uses the built WP to serve the site
  wordpress-trunk:
    skip_provisioning: true # provisioning this one takes longer, so it's disabled by default
    description: "An svn based WP Core trunk dev setup, useful for contributor days, Trac tickets, patches"
    repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template-develop.git
    hosts:
      - trunk.wordpress.test

  # The following commented out site configuration will create a environment useful
  # for contributions to the WordPress meta team, .e.g WordCamps, .org, etc:
  wordpress-meta-environment:
    skip_provisioning: false # disabled by default, this takes a long time to provision
    description: "An environment useful for contributions to the WordPress meta team."
    repo: https://github.com/WordPress/meta-environment.git
    hosts:
      - wp-meta.test
    custom:
      provision_site:
        "buddypressorg.test": true
        "jobs.wordpressnet.test": true
        "wordcamp.test": true
        "wordpressorg.test": true
        "wordpresstv.test": true

  # The following commented out site configuration will create a standard WordPress
  # site in www/example-site/ available at http://my-example-site.test.
  # Remember, whitespace is significant! Tabs and spaces mean different things
  #example-site:
  #  repo: https://github.com/Varying-Vagrant-Vagrants/custom-site-template.git
  #  hosts:
  #    - my-example-site.test

# Utilities https://varyingvagrantvagrants.org/docs/en-US/utilities/
# are system level items that aren't websites, that install tools or packages
# the core utilities install tools such as phpmyadmin
utilities:
  core: # The core VVV utility
    - tls-ca # HTTPS SSL/TLS certificates
    - phpmyadmin # Web based database client
    #- memcached-admin # Object cache management
    #- opcache-status # opcache management
    #- webgrind # PHP Debugging
    #- mongodb # needed for Tideways/XHGui
    #- tideways # PHP profiling tool, also installs xhgui check https://varyingvagrantvagrants.org/docs/en-US/references/tideways-xhgui/
    #- nvm # Node Version Manager
    #- php56
    #- php70
    #- php71
    #- php72
    #- php73
    #- php74

# 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.
# It can also be used to override the default provider being used within Vagrant.

vm_config:
  # For WP core development we recommend at least 2GB ( 2048 ),
  # If you have 4GB of RAM, lower this to 768MB or you may encounter issues
  memory: 2048
  # CPU cores:
  cores: 2

  # this tells VVV to use the prebuilt box copied from the USB drive at contributor days
  # once set to false, do not change back to true, and reprovision
  # wordcamp_contributor_day_box: false

  # 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
  # provider: virtualbox
  # provider: hyperv
  # provider: parallels
  # provider: vmware_desktop

# General VVV options
general:

  # Back up Options
  # You can always backup/restore manually using vagrant ssh -c "db_backup" or vagrant ssh -c "db_restore"

  # Backup the databases to the database/backups subfolder on halt/suspend/destroy, set to false to disable
  db_backup:
      enable: false
      gzip: true
      #exclude:
      #  - wordpress-trunk

  # Import the databases if they're missing from backups
  db_restore: true

  # set to true to use a synced shared folder for MariaDB database storage
  db_share_type: false

  # GitHub token to use from composer
  #github_token: xxxxxx

# Settings for the vagrant plugins supported by VVV
vagrant-plugins:
  disksize: 10GB # requires the disk size vagrant plugin
juanmaguitar commented 3 years ago

I think this was related to this Databases not created issue

Finally solved it by removing the folder, cloning it, and provisioning it again (something similar to the process suggested in the docs for asking for support)