bitnami / vms

Bitnami VMs
https://bitnami.com
Other
206 stars 44 forks source link

[Akeneo] webhook queue is not consumed by the worker #823

Closed Nicolas-Marjory closed 1 year ago

Nicolas-Marjory commented 1 year ago

Platform

AWS

bndiagnostic ID know more about bndiagnostic ID

8e9500ac-aafa-4238-3ad8-d8ee5583106f

bndiagnostic output

? Resources: Found possible issues
? Connectivity: Found possible issues
✓ Processes: No issues found
✓ Mysql: No issues found
? Apache: Found possible issues
✓ Php: No issues found

bndiagnostic was not useful. Could you please tell us why?

issues not related to the bug

Describe your issue as much as you can

Hello,

With the Akeneo packaged by Bitnami 7.0.11-2 the webhook worker managed by the akeneo_events_api_consumer systemd service is no more working properly :

Here related daemon.log entries:

Mar 31 14:10:53 ip-172-31-29-18 systemd[1]: Starting Akeneo PIM Events API consumer...
Mar 31 14:11:23 ip-172-31-29-18 systemd[1]: Started Akeneo PIM Events API consumer.
Mar 31 14:11:23 ip-172-31-29-18 php[24840]:  [OK] Consuming messages from transport "webhook".
Mar 31 14:11:23 ip-172-31-29-18 php[24840]:  // The worker will automatically exit once it has received a stop signal via
Mar 31 14:11:23 ip-172-31-29-18 php[24840]:  // the messenger:stop-workers command.
Mar 31 14:11:23 ip-172-31-29-18 php[24840]:  // Quit the worker with CONTROL-C.
Mar 31 14:11:23 ip-172-31-29-18 php[24840]:  // Re-run the command with a -vv option to see logs about consumed messages.
Mar 31 14:11:38 ip-172-31-29-18 php[24840]: /usr/bin/env: ‘php’: No such file or directory
Mar 31 14:11:57 ip-172-31-29-18 php[24840]: /usr/bin/env: ‘php’: No such file or directory

The worker is running but cannot process properly messages in the queue, in this context /usr/bin/env cannot found the proper php bin path.

(I did an ugly fix with symlink the /opt/bitnami/php/bin/php to /usr/bin/php to have it "working")

FYI We have another instance running the v6 bitnami package properly without this issue.

gongomgra commented 1 year ago

Hi @Nicolas-Marjory,

Thanks for reporting this issue. I launched a fresh new Akeneo 7.0.11-4 (latest version listed in bitnami.com)server version and I can't see the akeneo_events_api_consumer systemd service. Can you give us more details?

Nicolas-Marjory commented 1 year ago

Hello @gongomgra,

My bad i investigate more and it seems to be an issue with our terraform process... sorry for the inconvenience.

Nicolas-Marjory commented 1 year ago

@gongomgra In fact, our team did try to "manually" add this service through terraform because the webhook queue is missing in /opt/bitnami/scripts/akeneo/rundaemon.sh

#!/bin/bash

# shellcheck disable=SC1090,SC1091

set -o errexit
set -o nounset
set -o pipefail
# set -o xtrace # Uncomment this line for debugging purposes

# Load Akeneo environment
. /opt/bitnami/scripts/akeneo-env.sh

# Load PHP environment for 'php_conf_set' (after 'akeneo-env.sh' so that MODULE is not set to a wrong value)
. /opt/bitnami/scripts/php-env.sh

# Load libraries
. /opt/bitnami/scripts/libos.sh
. /opt/bitnami/scripts/liblog.sh
. /opt/bitnami/scripts/libservice.sh
. /opt/bitnami/scripts/libwebserver.sh

# Constants
declare -a cmd=("php" "$AKENEO_BIN_FILE"  messenger:consume ui_job import_export_job data_maintenance_job "--env=prod")

if am_i_root; then
    exec gosu "${AKENEO_DAEMON_USER}" "${cmd[@]}"
else
    exec "${cmd[@]}"
fi

The worker does not consume webhook

declare -a cmd=("php" "$AKENEO_BIN_FILE"  messenger:consume ui_job import_export_job data_maintenance_job "--env=prod")

Is it voluntary or is it an oversight ?

marcosbc commented 1 year ago

Hi @Nicolas-Marjory, we recently made some changes to the Akeneo OVA that might resolve the issue related to the PHP executable not being present.

You can check if you are using that OVA by executing the following command, and ensuring that it returns a valid output:

bitnami@debian:~$ sudo systemctl status bitnami.akeneo.service
● bitnami.akeneo.service - Bitnami service for akeneo
     Loaded: loaded (/etc/systemd/system/bitnami.akeneo.service; enabled; vendor preset: enabled)
     Active: active (running) since Wed 2023-04-05 11:03:29 UTC; 5min ago
   Main PID: 3243 (php)
      Tasks: 1 (limit: 2265)
     Memory: 28.1M
        CPU: 1.842s
     CGroup: /system.slice/bitnami.akeneo.service
             └─3243 /opt/bitnami/php/bin/php /opt/bitnami/akeneo/bin/console messenger:consume ui_job import_export_job data_maintenance_job --env=prod

Apr 05 11:03:29 debian systemd[1]: Started Bitnami service for akeneo.

The worker does not consume webhook

declare -a cmd=("php" "$AKENEO_BIN_FILE"  messenger:consume ui_job import_export_job data_maintenance_job "--env=prod")

Is it voluntary or is it an oversight ?

We are basing the job queue daemon configurations on the official recommendations from here: https://docs.akeneo.com/latest/install_pim/manual/daemon_queue.html

If there are missing options, maybe it could be worth escalating this in https://github.com/akeneo/pim-docs so that it gets fixed.

github-actions[bot] commented 1 year ago

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

github-actions[bot] commented 1 year ago

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.