Skip to content

Synthetics not working on new GCP VM #153

@paulb-elastic

Description

@paulb-elastic

Trying to run the docker examples from the Synthetics repo, but it fails with a permission error to the examples/todos folder when running on a GCP Debian VM.

Running run.sh, you get the error:

Ran /usr/share/heartbeat/.node/node/bin/npm install got npm WARN checkPermissions Missing write access to /opt/elastic-synthetics/examples/todos

When you look at the permissions inside the container, the mounted examples folder does not appear to be set up for the heartbeat user properly.

If you go into a running container (./bash.sh) and look at the permissions, the owner is set to 1018, not Heartbeat:

pwd
/opt/elastic-synthetics/examples/todos
bash-4.2$ ls -l
total 24
-rw-r--r-- 1 1018 1019  672 Nov 30 16:11 README.md
-rw-r--r-- 1 1018 1019  972 Nov 30 11:28 add-remove.journey.ts
drwxr-xr-x 2 1018 1019 4096 Nov 30 11:28 app
-rw-r--r-- 1 1018 1019  897 Nov 30 11:28 basics.journey.ts
-rw-r--r-- 1 1018 1019 1773 Nov 30 11:28 helpers.ts
-rw-r--r-- 1 1018 1019  264 Nov 30 11:28 package.json

There is no corresponding user for this, the heartbeat user is 1000

bash-4.2$ cat /etc/passwd | grep heartbeat
heartbeat:x:1000:1000::/usr/share/heartbeat:/bin/bash

Comparing it to a local Debian VM (not GCP), the owner of the mounted folder inside the container is heartbeat as expected:

bash-4.2$ pwd
/opt/elastic-synthetics/examples/todos
bash-4.2$ ls -l
total 32
-rw-r--r--  1 heartbeat heartbeat  672 Nov 30 09:58 README.md
-rw-r--r--  1 heartbeat heartbeat  972 Nov 30 09:58 add-remove.journey.ts
drwxr-xr-x  2 heartbeat heartbeat 4096 Nov 30 09:58 app
-rw-r--r--  1 heartbeat heartbeat  897 Nov 30 09:58 basics.journey.ts
-rw-r--r--  1 heartbeat heartbeat 1773 Nov 30 09:58 helpers.ts
drwxr-x--- 61 heartbeat heartbeat 4096 Nov 30 10:01 node_modules
-rw-r--r--  1 heartbeat heartbeat  264 Nov 30 09:58 package.json
-rwxr-x---  1 heartbeat heartbeat  707 Nov 30 10:06 paulb.journey.ts

In summary, this results in the container not having write permissions to the /opt/elastic-synthetics/examples/todos folder, so the test fails to run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions