gitpod icon indicating copy to clipboard operation
gitpod copied to clipboard

Using MySQL base image produces errors in task terminals

Open JuJup opened this issue 2 years ago • 7 comments

Bug description

When using the gitpod/workspace-mysql image, the MySQL Setup produces a couple of errors in each terminal (tested on latest and gitpod/workspace-mysql:2023-02-27-14-39-56)

HISTFILE=/workspace/.gitpod/cmd-1 history -r; {
echo "init test 2"
} && {
echo "command test 2"
}
mysqld: Error on delete of '/workspace/mysql/mysqld_tmp_file_case_insensitive_test.lower-test' (OS errno 2 - No such file or directory)
mysqld: Error on delete of '/workspace/mysql/mysqld_tmp_file_case_insensitive_test.lower-test' (OS errno 2 - No such file or directory)
mysqld will log errors to /var/log/mysql/error.log
2023-08-11T08:35:57.482500Z 0 [ERROR] [MY-011065] [Server] Unable to determine if daemon is running: Invalid argument (rc=0).
2023-08-11T08:35:57.482548Z 0 [ERROR] [MY-010946] [Server] Failed to start mysqld daemon. Check mysqld error log.

The errors are not always the same, depending on how fast the terminal starts it might be more or even no error. However, the database is working fine so far, it's just the error outputs.

I suppose this is somehow caused by the mysql-bashrc-launch.sh script, which is executed via .bashrc.

Steps to reproduce

Creating simple .gitpod.yml and do gp validate or push and create a new workspace. Then check the already opened terminals in VS Code.

image: gitpod/workspace-mysql

tasks:
  - name: Test 1
    init: echo "init test 1"
    command: echo "command test 1"
  - name: Test 2
    init: echo "init test 2"
    command: echo "command test 2"
  - name: Test 3
    init: echo "init test 3"
    command: echo "command test 3"
  - name: Test 4
    init: echo "init test 4"
    command: echo "command test 4"
  - name: Test 5
    init: echo "init test 5"
    command: echo "command test 5"

Workspace affected

No response

Expected behavior

No Error Messages, if there are no Errors.

Example repository

No response

Anything else?

After all - is there any reason why I should use this image and not simply start a MySQL Dockercontainer? That way I could even control the Version to be equivalent to my prod Database.

JuJup avatar Aug 11 '23 08:08 JuJup

There seems to be another side effect - at least I think it's somehow connected. When I use gp validate, the MySQL Server won't start properly, so all my cmd tasks that do a gp ports await 3306 are not executed. This is quite annoying as I can't really test my setup that way.

JuJup avatar Aug 14 '23 17:08 JuJup

Hi @JuJup, thanks for reporting. https://github.com/gitpod-io/workspace-images/pull/1104 has an explanation for why this may be happening.

axonasif avatar Aug 17 '23 18:08 axonasif

We want to reconsider our mysql image to remove auto start magic. Curren bash scripts are breaking while several shells are racing. Instead you will add an explicit task to start mysql server it won't be done by sourcing bash scripts each time. It is already scheduled. cc @jeanp413 @laushinka

akosyakov avatar Sep 15 '23 07:09 akosyakov

@akosyakov is there any PR or issue for what you described so I can check the current status?

JuJup avatar Nov 14 '23 20:11 JuJup

Sorry, unfortunately it was unscheduled because of other priorities.

akosyakov avatar Nov 15 '23 10:11 akosyakov

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar May 23 '24 15:05 github-actions[bot]

Is there any further development on the mysql base image? From what I see, the problem still occurs and in your documentation the workspace-mysql image is still mentioned as the preferred way to run mysql in Gitpod.

JuJup avatar May 29 '24 21:05 JuJup