Skip to content

Mac M2 issue? Either Varnish or ElasticSearch doesn't start & Bad Gateway 502 #86

@marcoveeneman

Description

@marcoveeneman

Hi,

Since a while I noticed my dev containers using hypernode-docker containers don't work anymore on my M2 MacBook Pro. Depending on the "Use Rosetta for x86_64/amd64 emulation on Apple Silicon" setting, either varnish or elasticsearch won't start. This happens for existing containers, as well as new containers with the latest image. Something in docker must have changed somehow because think I updated Docker Desktop a while ago.

  • With "Use Rosetta for x86_64/amd64 emulation on Apple Silicon" enabled, this is the list of 'screen' commands that keep running:
root@285bad760d6b / # screen -ls
There are screens on:
        267.hypernode_service_varnish   (04/18/2024 10:56:53 AM)        (Detached)
        180.hypernode_service_php       (04/18/2024 10:56:52 AM)        (Detached)
        189.hypernode_service_mysql     (04/18/2024 10:56:52 AM)        (Detached)
        194.hypernode_service_mailhog   (04/18/2024 10:56:52 AM)        (Detached)
        170.hypernode_service_nginx     (04/18/2024 10:56:51 AM)        (Detached)
        173.hypernode_service_redis     (04/18/2024 10:56:51 AM)        (Detached)
6 Sockets in /run/screen/S-root.

Trying to start elastic search manually gives the following console output:

root@285bad760d6b / # mkdir -p /var/run/elasticsearch; chown -R elasticsearch /var/run/elasticsearch; su -s /bin/bash -c 'source /etc/default/elasticsearch; export ES_HOME=/usr/share/elasticsearch; export ES_PATH_CONF=/etc/elasticsearch; export PID_DIR=/var/run/elasticsearch; export ES_SD_NOTIFY=true; /usr/share/elasticsearch/bin/elasticsearch -p /var/run/elasticsearch/elasticsearch.pid --quiet' elasticsearch
Exception in thread "main" java.io.IOException: Cannot run program "/usr/share/elasticsearch/jdk/bin/java": error=0, Failed to exec spawn helper.
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1128)
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1071)
        at org.elasticsearch.tools.launchers.JvmErgonomics.flagsFinal(JvmErgonomics.java:111)
        at org.elasticsearch.tools.launchers.JvmErgonomics.finalJvmOptions(JvmErgonomics.java:88)
        at org.elasticsearch.tools.launchers.JvmErgonomics.choose(JvmErgonomics.java:59)
        at org.elasticsearch.tools.launchers.JvmOptionsParser.main(JvmOptionsParser.java:95)
Caused by: java.io.IOException: error=0, Failed to exec spawn helper.
        at java.base/java.lang.ProcessImpl.forkAndExec(Native Method)
        at java.base/java.lang.ProcessImpl.<init>(ProcessImpl.java:319)
        at java.base/java.lang.ProcessImpl.start(ProcessImpl.java:250)
        at java.base/java.lang.ProcessBuilder.start(ProcessBuilder.java:1107)
        ... 5 more
  • With "Use Rosetta for x86_64/amd64 emulation on Apple Silicon" disabled, this is the list of 'screen' commands that keep running:
root@285bad760d6b / # screen -ls
There are screens on:
        696.hypernode_service_elasticsearch     (04/18/2024 10:18:44 AM)        (Detached)
        526.hypernode_service_redis     (04/18/2024 10:18:39 AM)        (Detached)
        563.hypernode_service_mysql     (04/18/2024 10:18:39 AM)        (Detached)
        545.hypernode_service_php       (04/18/2024 10:18:39 AM)        (Detached)
        518.hypernode_service_nginx     (04/18/2024 10:18:38 AM)        (Detached)

Trying to start varnish manually gives the following console output:

root@285bad760d6b / # $VARNISH_COMMAND
Error:
Message from VCC-compiler:
Assert error in vju_subproc(), mgt/mgt_jail_unix.c line 212:
  Condition((initgroups(vju_user, vju_gid)) == 0) not true.
  errno = 1 (Operation not permitted)
qemu: uncaught target signal 6 (Aborted) - core dumped
Running VCC-compiler failed, signal 6
VCL compilation failed

In this situation (varnish not running), the frontend appears to work correctly, but after logging in to the admin panel, nginx will return a 502 Bad Gateway.

I'm wondering if anyone is experiencing the same issue, and if there is a (simple) fix available.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions