Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-130029

mysqld doesn't start in image mode due to missing/invalid user

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • rhel-9.8
    • mysql
    • None
    • rhel-databases
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • All
    • None

      What were you trying to do that didn't work?

      :: [ 18:47:58 ] :: [   FAIL   ] :: Command 
      'rlServiceStart "mysqld"' (Expected 0, got 1)
      :: [ 18:47:58 ] :: [  BEGIN   ] :: Running 'service mysqld status'
      Redirecting to /bin/systemctl status mysqld.service
      ● mysqld.service - MySQL 8.4 database server
           Loaded: loaded (/usr/lib/systemd/system/mysqld.service; disabled; preset: disabled)
           Active: activating (auto-restart) (Result: exit-code) since Thu 2025-11-20 18:47:58 UTC; 5ms ago
       Invocation: 4bf99507d98846589e0711603177bae8
          Process: 4015 ExecStartPre=/usr/libexec/mysql-check-socket (code=exited, status=217/USER)
          Process: 4019 ExecStopPost=/usr/libexec/mysql-wait-stop (code=exited, status=217/USER)
         Mem peak: 1.3M
              CPU: 7ms

      Nov 20 18:47:58 565a9726-b0d3-4148-a437-33fd63aaeb88 systemd[1]: mysqld.service: Control process exited, code=exited, status=217/USER
      Nov 20 18:47:58 565a9726-b0d3-4148-a437-33fd63aaeb88 systemd[1]: mysqld.service: Failed with result 'exit-code'.
      Nov 20 18:47:58 565a9726-b0d3-4148-a437-33fd63aaeb88 systemd[1]: Failed to start mysqld.service - MySQL 8.4 database server.
      :: [ 18:47:58 ] :: [   FAIL   ] :: Command 'service mysqld status' (Expected 0, got 3)
      :: [ 18:47:58 ] :: [   FAIL   ] :: Command 'mysqlStart' (Expected 0, got 3)
      Nov 20 18:47:58 565a9726-b0d3-4148-a437-33fd63aaeb88 systemd[1]: Starting mysqld.service - MySQL 8.4 database server...
      ░░ Subject: A start job for unit mysqld.service has begun execution
      ░░ Defined-By: systemd
      ░░ Support: https://access.redhat.com/support
      ░░ 
      ░░ A start job for unit mysqld.service has begun execution.
      ░░ 
      ░░ The job identifier is 2144.
      Nov 20 18:47:58 565a9726-b0d3-4148-a437-33fd63aaeb88 (k-socket)[3910]: mysqld.service: Failed to determine user credentials: No such process
      Nov 20 18:47:58 565a9726-b0d3-4148-a437-33fd63aaeb88 (k-socket)[3910]: mysqld.service: Failed at step USER spawning /usr/libexec/mysql-check-socket: No such process
      ░░ Subject: Process /usr/libexec/mysql-check-socket could not be executed
      ░░ Defined-By: systemd
      ░░ Support: https://access.redhat.com/support
      ░░ 
      ░░ The process /usr/libexec/mysql-check-socket could not be executed and failed.
      ░░ 
      ░░ The error number returned by this process is 3.
      Nov 20 18:47:58 565a9726-b0d3-4148-a437-33fd63aaeb88 systemd[1]: mysqld.service: Control process exited, code=exited, status=217/USER
      ░░ Subject: Unit process exited
      ░░ Defined-By: systemd
      ░░ Support: https://access.redhat.com/support
      ░░ 
      ░░ An ExecStartPre= process belonging to unit mysqld.service has exited.
      ░░ 
      ░░ The process' exit code is 'exited' and its exit status is 217.
      Nov 20 18:47:58 565a9726-b0d3-4148-a437-33fd63aaeb88 (ait-stop)[3911]: mysqld.service: Failed to determine user credentials: No such process
      Nov 20 18:47:58 565a9726-b0d3-4148-a437-33fd63aaeb88 (ait-stop)[3911]: mysqld.service: Failed at step USER spawning /usr/libexec/mysql-wait-stop: No such process
      ░░ Subject: Process /usr/libexec/mysql-wait-stop could not be executed
      ░░ Defined-By: systemd
      ░░ Support: https://access.redhat.com/support
      ░░ 
      ░░ The process /usr/libexec/mysql-wait-stop could not be executed and failed.
      ░░ 
      ░░ The error number returned by this process is 3.
      Nov 20 18:47:58 565a9726-b0d3-4148-a437-33fd63aaeb88 systemd[1]: mysqld.service: Control process exited, code=exited, status=217/USER
      ░░ Subject: Unit process exited
      ░░ Defined-By: systemd
      ░░ Support: https://access.redhat.com/support
      ░░ 
      ░░ An ExecStopPost= process belonging to unit mysqld.service has exited.
      ░░ 
      ░░ The process' exit code is 'exited' and its exit status is 217.
      Nov 20 18:47:58 565a9726-b0d3-4148-a437-33fd63aaeb88 systemd[1]: mysqld.service: Failed with result 'exit-code'.
      ░░ Subject: Unit failed
      ░░ Defined-By: systemd
      ░░ Support: https://access.redhat.com/support
      ░░ 
      ░░ The unit mysqld.service has entered the 'failed' state with result 'exit-code'.
      Nov 20 18:47:58 565a9726-b0d3-4148-a437-33fd63aaeb88 systemd[1]: Failed to start mysqld.service - MySQL 8.4 database server.
      ░░ Subject: A start job for unit mysqld.service has failed
      ░░ Defined-By: systemd
      ░░ Support: https://access.redhat.com/support
      ░░ 
      ░░ A start job for unit mysqld.service has finished with a failure.
      ░░ 
      ░░ The job identifier is 2144 and the job result is failed.
      Nov 20 18:47:58 565a9726-b0d3-4148-a437-33fd63aaeb88 systemd[1]: mysqld.service: Scheduled restart job, restart counter is at 1.
      ░░ Subject: Automatic restarting of a unit has been scheduled
      ░░ Defined-By: systemd
      ░░ Support: https://access.redhat.com/support
      ░░ 
      ░░ Automatic restarting of the unit mysqld.service has been scheduled, as the result for
      ░░ the configured Restart= setting for the unit.
      Nov 20 18:47:58 565a9726-b0d3-4148-a437-33fd63aaeb88 systemd[1]: Starting mysqld.service - MySQL 8.4 database server...
      ░░ Subject: A start job for unit mysqld.service has begun execution
      ░░ Defined-By: systemd
      ░░ Support: https://access.redhat.com/support
      ░░ 
      ░░ A start job for unit mysqld.service has begun execution.
      ░░ 
      ░░ The job identifier is 2255.
      Nov 20 18:47:58 565a9726-b0d3-4148-a437-33fd63aaeb88 (k-socket)[4015]: mysqld.service: Failed to determine user credentials: No such process
      Nov 20 18:47:58 565a9726-b0d3-4148-a437-33fd63aaeb88 (k-socket)[4015]: mysqld.service: Failed at step USER spawning /usr/libexec/mysql-check-socket: No such process
      ░░ Subject: Process /usr/libexec/mysql-check-socket could not be executed
      ░░ Defined-By: systemd
      ░░ Support: https://access.redhat.com/support
      ░░ 
      ░░ The process /usr/libexec/mysql-check-socket could not be executed and failed.
      ░░ 
      ░░ The error number returned by this process is 3.
      Nov 20 18:47:58 565a9726-b0d3-4148-a437-33fd63aaeb88 systemd[1]: mysqld.service: Control process exited, code=exited, status=217/USER
      ░░ Subject: Unit process exited
      ░░ Defined-By: systemd
      ░░ Support: https://access.redhat.com/support
      ░░ 
      ░░ An ExecStartPre= process belonging to unit mysqld.service has exited.
      ░░ 
      ░░ The process' exit code is 'exited' and its exit status is 217.
      Nov 20 18:47:58 565a9726-b0d3-4148-a437-33fd63aaeb88 systemd[1]: mysqld.service: Control process exited, code=exited, status=217/USER
      ░░ Subject: Unit process exited
      ░░ Defined-By: systemd
      ░░ Support: https://access.redhat.com/support
      ░░ 
      ░░ An ExecStopPost= process belonging to unit mysqld.service has exited.
      ░░ 
      ░░ The process' exit code is 'exited' and its exit status is 217.
      Nov 20 18:47:58 565a9726-b0d3-4148-a437-33fd63aaeb88 systemd[1]: mysqld.service: Failed with result 'exit-code'.
      ░░ Subject: Unit failed
      ░░ Defined-By: systemd
      ░░ Support: https://access.redhat.com/support
      ░░ 
      ░░ The unit mysqld.service has entered the 'failed' state with result 'exit-code'.
      Nov 20 18:47:58 565a9726-b0d3-4148-a437-33fd63aaeb88 systemd[1]: Failed to start mysqld.service - MySQL 8.4 database server.
      ░░ Subject: A start job for unit mysqld.service has failed
      ░░ Defined-By: systemd
      ░░ Support: https://access.redhat.com/support
      ░░ 
      ░░ A start job for unit mysqld.service has finished with a failure.
      ░░ 
      ░░ The job identifier is 2255 and the job result is failed. 

       

      AI investigation:

      The error is clear: exit status 217/USER means systemd failed to determine user credentials for the mysql user. The error "Failed to determine user credentials: No
       such process" indicates the mysql user doesn't exist in the image.

       Since /usr is read-only in image mode, you can't modify system files or create new users in the traditional way. Here are your options:

       Option 1: Use an overlayfs or tmpfs for writable paths (Recommended)

       Create writable directories for MySQL's runtime needs:

       # Create overlay or temp directories for MySQL
       mkdir -p /var/run/mysqld
       mkdir -p /var/lib/mysql
       chmod 777 /var/run/mysqld
       chmod 777 /var/lib/mysql

       # Start mysqld directly instead of via systemd
       mysqld --user=root --datadir=/var/lib/mysql --socket=/var/run/mysqld/mysqld.sock &

       Option 2: Modify the service file to not require a specific user

       If you have write access to /etc/systemd/system/, create an override:

       mkdir -p /etc/systemd/system/mysqld.service.d/
       cat > /etc/systemd/system/mysqld.service.d/override.conf << EOF
       [Service]
       User=root
       Group=root
       EOF

       systemctl daemon-reload
       systemctl start mysqld

       Option 3: Use a different initialization approach

       Instead of systemd, use a custom script in your test setup:

       # Run MySQL without systemd
       mysqld_safe --skip-grant-tables --datadir=/tmp/mysql &
       # or
       mysqld --user=root --datadir=/tmp/mysql --socket=/tmp/mysql.sock &

       For image mode specifically:

       The cleanest approach is to pre-create necessary users and directories during the image build phase (if possible), or use Option 1 to set up temporary writable
       locations at test runtime before starting mysqld.

      mariadb works as expected in IM.

      What is the impact of this issue to you?

      I can't test my components which require mysql

      Please provide the package NVR for which the bug is seen:

      mysql8.4-8.4.6-2.el10_0

      How reproducible is this bug?:

      Always

      Steps to reproduce

      1.  testing-farm request --arch x86_64 --git-url https://gitlab.com/redhat/rhel/tests/perl-DBD-MySQL/ --git-ref master --compose RHEL-10.2-image-mode --context distro=RHEL-10.2 --plan plans/general --context deployment-mode=image --tmt-environment TMT_POLICY_NAME=rhel-ci --no-wait
      2.  
      3.  

      Expected results

      Actual results

              mschorm@redhat.com Michal Schorm
              mkyral@redhat.com Martin Kyral
              Michal Schorm Michal Schorm
              Vaclav Danek Vaclav Danek
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: