Uploaded image for project: 'Percona Monitoring and Management'
  1. Percona Monitoring and Management
  2. PMM-10431

The PMM_AGENT_PRERUN_SCRIPT fails for k8s operators with dev-latest image

Details

    • Bug
    • Status: Done
    • Medium
    • Resolution: Fixed
    • None
    • 2.30.0
    • None
    • Yes
    • Yes
    • 1
    • Yes
    • No
    • No
    • Server Integrations

    Description

      Operators have some pre-run script defined in environment variable PMM_AGENT_PRERUN_SCRIPT, but for some reason it is failing when first run.

      Content of pre-run script inside PMM_AGENT_PRERUN_SCRIPT:

      PMM_AGENT_PRERUN_SCRIPT=pmm-admin status --wait=10s;
      pmm-admin add ${DB_TYPE} ${PMM_ADMIN_CUSTOM_PARAMS} --skip-connection-check --metrics-mode=${PMM_AGENT_SETUP_METRICS_MODE} --username=${DB_USER} --password=${DB_PASSWORD} --cluster=${CLUSTER_NAME} --service-name=${PMM_AGENT_SETUP_NODE_NAME} --host=${POD_NAME} --port=${DB_PORT} ${DB_ARGS};
      pmm-admin annotate --service-name=${PMM_AGENT_SETUP_NODE_NAME} 'Service restarted'
      

      Short log:

      INFO[2022-07-29T06:20:55.761+00:00] Running prerun shell script pmm-admin status --wait=10s;
      pmm-admin add ${DB_TYPE} ${PMM_ADMIN_CUSTOM_PARAMS} --skip-connection-check --metrics-mode=${PMM_AGENT_SETUP_METRICS_MODE} --username=${DB_USER} --password=${DB_PASSWORD} --cluster=${CLUSTER_NAME} --s
      ervice-name=${PMM_AGENT_SETUP_NODE_NAME} --host=${POD_NAME} --port=${DB_PORT} ${DB_ARGS};
      pmm-admin annotate --service-name=${PMM_AGENT_SETUP_NODE_NAME} 'Service restarted'...  component=entrypoint
      INFO[2022-07-29T06:20:55.763+00:00] Done.                                         component=local-server
      INFO[2022-07-29T06:20:55.763+00:00] Done.                                         component=main
      /bin/sh: pmm-admin status --wait=10s;
      pmm-admin add ${DB_TYPE} ${PMM_ADMIN_CUSTOM_PARAMS} --skip-connection-check --metrics-mode=${PMM_AGENT_SETUP_METRICS_MODE} --username=${DB_USER} --password=${DB_PASSWORD} --cluster=${CLUSTER_NAME} --s
      ervice-name=${PMM_AGENT_SETUP_NODE_NAME} --host=${POD_NAME} --port=${DB_PORT} ${DB_ARGS};
      pmm-admin annotate --service-name=${PMM_AGENT_SETUP_NODE_NAME} 'Service restarted': File name too long
      INFO[2022-07-29T06:20:55.766+00:00] Stopping pmm-agent...                         component=entrypoint
      WARN[2022-07-29T06:20:55.767+00:00] Can't get exit code for pmm-agent. Error code: wait: no child processes  component=entrypoint
      INFO[2022-07-29T06:20:55.767+00:00] Starting 'pmm-admin run'...                   component=entrypoint
      

      Notice " File name too long" and "Can't get exit code for pmm-agent." in the log.

      Full log with dev-latest pmm client image: pmm-client-dev-latest.log
      Env variables: env.log
      Config file: pmm-agent.yaml

      Full log with 2.29 version seems to work: pmm-client-2.29.log

      Attachments

        1. pmm-client-dev-latest.log
          72 kB
        2. pmm-client-2.29.log
          48 kB
        3. pmm-agent.yaml
          1 kB
        4. env.log
          5 kB

        Activity

          People

            Unassigned Unassigned
            tomislav.plavcic@percona.com Tomislav Plavcic
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Smart Checklist