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

[BUG] Mysql occasionally unavailable during 'init' step with Gitpod setup #431

Open
mrchrisadams opened this issue Apr 5, 2023 · 1 comment
Labels
bug Something isn't working Severity: low Bug severity level

Comments

@mrchrisadams
Copy link
Member

Please choose the appropriate severity level accompanied by this report by removing the excess severity labels.

Describe the bug

On at least two occasions, setting up a workspace has not worked as expected, because the following steps assume that a mysql server is running in our init task with gitpod:

cp ./.env.gitpod ./.env
mysqladmin create greencheck
python -m pipenv install --dev
python -m pipenv run python ./manage.py migrate
python -m pipenv run python ./manage.py tailwind install
python -m pipenv run python ./manage.py tailwind build
cd ./apps/theme/static_src/
npx rollup --config
cd ../../../
python -m pipenv run python ./manage.py collectstatic --no-input

To Reproduce

Create a workspace with gitpod

Expected behavior

Our init task completes successfully

Actual behavior

Occasionally this mysql is not running when the init tasks runs, and we see the following error in the terminal:

mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)'
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!

Additional context

This is fixable by using the gp sync-await and gp sync-done commands in our init step which are specifically designed to delay actions until a service is available and so on.

https://www.gitpod.io/docs/references/gitpod-cli#sync-await

@mrchrisadams mrchrisadams added bug Something isn't working Severity: low Bug severity level labels Apr 5, 2023
@mrchrisadams
Copy link
Member Author

There is also a gp rebuild task available, specifically designed to debug these kinds of issues

https://www.gitpod.io/docs/references/gitpod-cli#rebuild

One to remember for when we come back to this in future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Severity: low Bug severity level
Projects
None yet
Development

No branches or pull requests

1 participant