Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database type/version conflict on config->start->get #58

Open
rfay opened this issue Nov 9, 2022 · 2 comments
Open

Database type/version conflict on config->start->get #58

rfay opened this issue Nov 9, 2022 · 2 comments

Comments

@rfay
Copy link
Member

rfay commented Nov 9, 2022

DDEV in recent versions checks on start and config to make sure the configured database type/version is the same as the actual database type (if one exists).

So if people create a project (or it already exists), perhaps with the default mariadb:10.4 type, and then do a ddev get and the .platform/services.yml provides a different type or version, then people get a fairly ugly message.

Failed to start WordPress-Composer-Template-Tester: Unable to start project WordPress-Composer-Template-Tester because the configured database type does not match the current actual database. Please change your database type back to mariadb:10.4 and start again, export, delete, and then change configuration and start. To get back to existing type use 'ddev config --database=mariadb:10.4' and then you might want to try 'ddev debug migrate-database mariadb:10.5', see docs at https://ddev.readthedocs.io/en/latest/users/extend/database_types/

Since that message is buried at the bottom of loads of incomprehensible complaints, it's annoying and difficult for a first-time user.

@thewheat
Copy link

I believe I ran into this issue as well

.services.yaml

db:
   type: mariadb:10.2
   disk: 2048
...

.ddev/config.yaml

...
database:
    type: mariadb
    version: "10.4"
...

I believe the workaroud is just to modify .ddev/config.yaml to the correct version as that is what the database config should be for https://ddev.readthedocs.io/en/latest/users/configuration/config/#database

And depending on what state the project is in, I needed to do a ddev delete as well.


I tried to replicate this again to get a clearer reproduction steps but am failing to get the error message but pasting my output that I had below and the steps that I did was as follows

  • ddev config
  • ddev get drud/ddev-platformsh error
  • modify .ddev/config.yaml
  • ddev get drud/ddev-platformsh success
$ ddev get drud/ddev-platformsh
Downloading https://api.github.com/repos/ddev/ddev-platformsh/tarball/v0.7.0 
v0.7.0_614027329.tar.gz 417.62 KiB / 417.62 KiB [=============================================================================================================================================] 100.00% 0s

Executing pre-install actions: 
👍 Checking DDEV version 
👍 Check for required tools base64, jq, perl 
Using existing PLATFORMSH_CLI_TOKEN.
 
👍 Setting PLATFORMSH_CLI_TOKEN 
Please enter your platform.sh project ID (like '6k4ypl5iendqd'):  
qqlugg2jush26
platform_project = 'qqlugg2jush26'
You are reconfiguring the project at ~/src/psh-test/php.
The existing configuration will be updated and replaced.
Configuring unrecognized codebase as project type 'php' at ~/src/psh-test/php/_www
Unable to configure project php with database type mariadb:10.2 because that database type does not match the current actual database. Please change your database type back to mariadb:10.2 and start again, export, delete, and then change configuration and start. To get back to existing type use 'ddev config --database=mariadb:10.2', and you can try a migration with 'ddev debug migrate-database mariadb:10.4' see docs at https://ddev.readthedocs.io/en/latest/users/extend/database-types/
 
👎 Set PLATFORM_PROJECT 
could not process pre-install action (5) 'Set PLATFORM_PROJECT'. For more detail use ddev get --verbose 

After modifying .ddev/config.yaml

ddev get drud/ddev-platformsh
Downloading https://api.github.com/repos/ddev/ddev-platformsh/tarball/v0.7.0 
v0.7.0_1881456197.tar.gz 417.62 KiB / 417.62 KiB [============================================================================================================================================] 100.00% 0s

Executing pre-install actions: 
👍 Checking DDEV version 
👍 Check for required tools base64, jq, perl 
Using existing PLATFORMSH_CLI_TOKEN.
 
👍 Setting PLATFORMSH_CLI_TOKEN 
Please enter your platform.sh project ID (like '6k4ypl5iendqd'):  
qqlugg2jush26
platform_project = 'qqlugg2jush26'
You are reconfiguring the project at ~/src/psh-test/php.
The existing configuration will be updated and replaced.
Configuring unrecognized codebase as project type 'php' at ~/src/psh-test/php/_www
Configuration complete. You may now run 'ddev start'.
PLATFORM_PROJECT set to qqlugg2jush26
 
👍 Set PLATFORM_PROJECT 
You are reconfiguring the project at ~/src/psh-test/php.
The existing configuration will be updated and replaced.
Configuring unrecognized codebase as project type 'php' at ~/src/psh-test/php/_www
Configuration complete. You may now run 'ddev start'.
 
👍 Setting PLATFORM_APPLICATION_NAME 
Please enter your platform.sh project environment (like 'main'):  
main
You are reconfiguring the project at ~/src/psh-test/php.
The existing configuration will be updated and replaced.
Configuring unrecognized codebase as project type 'php' at ~/src/psh-test/php/_www
Configuration complete. You may now run 'ddev start'.
 

Installing project-level components: 
👍 web-build/Dockerfile.platformsh 
👍 homeadditions/.bashrc.d/platformsh-environment.sh 
👍 platformsh/.gitignore 
👍 platformsh/generate_db_relationship.sh 
👍 platformsh/generate_elasticsearch_relationship.sh 
👍 platformsh/generate_memcached_relationship.sh 
👍 platformsh/generate_redis_relationship.sh 

Installing global components: 
👍 commands/web/platform 

Executing post-install actions: 
👍 Support composer and python3 dependencies 
👍  Install .environment file into web-entrypoint.d if needed 
BASE64_ENCODE=base64 -w 0
 
👍 Installing dependencies and generating needed environment variables 

Installed DDEV add-on drud/ddev-platformsh, use `ddev restart` to enable. 
Please read instructions for this addon at the source repo at
https://github.com/drud/ddev-platformsh
Please file issues and create pull requests there to improve it. 

@rfay
Copy link
Member Author

rfay commented Mar 14, 2023

If the database doesn't exist (if the project has never been started), there is nothing to do.

If the database already exists, then one can either ddev delete -Oy, which will destroy it to start out fresh, or migrate the database.

This is explained in the README notes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants