supabase / supabase-grafana

Observability for your Supabase project, using Prometheus/Grafana
https://supabase.com
MIT License
189 stars 37 forks source link

LIne ending issue with `entrypoint.sh` #10

Closed Gipetto closed 3 months ago

Gipetto commented 10 months ago

Bug report

Describe the bug

First run starting up per the directions results in the docker container unable to execute the entrypoint file:

$ docker compose up
[+] Building 17.0s (20/20) FINISHED                                                                             docker:default
 => [supabase-grafana internal] load .dockerignore                                                                        0.1s
 => => transferring context: 128B                                                                                         0.0s
 => [supabase-grafana internal] load build definition from Dockerfile                                                     0.1s
 => => transferring dockerfile: 1.44kB                                                                                    0.0s
 => [supabase-grafana internal] load metadata for docker.io/grafana/grafana:9.5.6-ubuntu                                  1.4s
 => [supabase-grafana internal] load metadata for docker.io/prom/prometheus:v2.45.0                                       1.4s
 => [supabase-grafana auth] grafana/grafana:pull token for registry-1.docker.io                                           0.0s
 => [supabase-grafana auth] prom/prometheus:pull token for registry-1.docker.io                                           0.0s
 => [supabase-grafana internal] load build context                                                                        0.0s
 => => transferring context: 458.29kB                                                                                     0.0s
 => [supabase-grafana grafana  1/11] FROM docker.io/grafana/grafana:9.5.6-ubuntu@sha256:3cc5ad0d60b12430f67a6aa8b6578861  5.1s
 => => resolve docker.io/grafana/grafana:9.5.6-ubuntu@sha256:3cc5ad0d60b12430f67a6aa8b6578861befbf68452451099839abb7bd71  0.0s
 => => sha256:3cc5ad0d60b12430f67a6aa8b6578861befbf68452451099839abb7bd71b5a8b 1.11kB / 1.11kB                            0.0s
 => => sha256:f1cb712add18b8f2fb85226c00dd7cc3b94e4e8c848ee05e8b21bfcf6005ec17 7.55kB / 7.55kB                            0.0s
 => => sha256:2716f68767abab4985fd2fe64bc3a3a46ebf31e20e0eb844cbcb60bc8b1e84c2 2.20kB / 2.20kB                            0.0s
 => => sha256:18964caab1f2fd5f582bcdb423eced354b1939cb816f90f4cf9e2351c32cbe42 140B / 140B                                1.6s
 => => sha256:9231a37c5af9cb7075607b61ab8c0dc9e466133430b1dc9008c920ba17097d79 7.65MB / 7.65MB                            2.0s
 => => sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1 32B / 32B                                  1.6s
 => => extracting sha256:18964caab1f2fd5f582bcdb423eced354b1939cb816f90f4cf9e2351c32cbe42                                 0.0s
 => => sha256:41e50e35d7f41dbf5fe9af82a547412307b8545a496e857392f25de5382560b5 39.14kB / 39.14kB                          2.0s
 => => sha256:205bb0edefa04e65e057ad6a3a6901a7d7a9f7a7312f7c07fd8c08f6bca891b8 20.55kB / 20.55kB                          1.9s
 => => sha256:1bc7ed071af7ac1262c49942735a5a9555853d48c839435404059a7324033434 36.27MB / 36.27MB                          2.7s
 => => sha256:8ab8cf1b9f693d9c258772edb935716cf06de4cbccf79685cb24a41f0e269cf1 42.91MB / 42.91MB                          3.5s
 => => extracting sha256:9231a37c5af9cb7075607b61ab8c0dc9e466133430b1dc9008c920ba17097d79                                 0.3s
 => => sha256:83e6703457a1d3869a2d5a9bde321d2421c95da790d0722544a725d0e3d5a0cd 1.23kB / 1.23kB                            2.2s
 => => extracting sha256:4f4fb700ef54461cfa02571ae0db9a0dc1e0cdb5577484a6d75e68dc38e8acc1                                 0.0s
 => => extracting sha256:41e50e35d7f41dbf5fe9af82a547412307b8545a496e857392f25de5382560b5                                 0.0s
 => => extracting sha256:205bb0edefa04e65e057ad6a3a6901a7d7a9f7a7312f7c07fd8c08f6bca891b8                                 0.0s
 => => extracting sha256:1bc7ed071af7ac1262c49942735a5a9555853d48c839435404059a7324033434                                 0.6s
 => => extracting sha256:8ab8cf1b9f693d9c258772edb935716cf06de4cbccf79685cb24a41f0e269cf1                                 1.2s
 => => extracting sha256:83e6703457a1d3869a2d5a9bde321d2421c95da790d0722544a725d0e3d5a0cd                                 0.0s
 => [supabase-grafana prometheus 1/1] FROM docker.io/prom/prometheus:v2.45.0@sha256:9309deb7c981e8a94584d9ed689fd62f7ac4  3.0s
 => => resolve docker.io/prom/prometheus:v2.45.0@sha256:9309deb7c981e8a94584d9ed689fd62f7ac4549d816fd3881550311cf056a237  0.0s
 => => sha256:9309deb7c981e8a94584d9ed689fd62f7ac4549d816fd3881550311cf056a237 1.73kB / 1.73kB                            0.0s
 => => sha256:e1fbd49323c628ccc8c11aea113eddc294c4bd1887dc627d175331c325df10fd 6.50kB / 6.50kB                            0.0s
 => => sha256:377894421d88619dc51dbcd46ceba75a5ea842b0a878f173e6476f20c1645630 2.82kB / 2.82kB                            0.0s
 => => sha256:5d47f929abda9f4ed6ed1d31458b644e1ef3c9dcf45767b50f4ebed4b6f05645 48.32MB / 48.32MB                          1.0s
 => => sha256:30ec41fb8fedfcefdb27a52e9c73ef6ae7e48d48e544c3dbafc08a91795ca1ec 778.85kB / 778.85kB                        0.2s
 => => sha256:e5f8ba06cb61cde2aee91c15c4b865821023a80ba36d8d1ba529739563d347a6 626.66kB / 626.66kB                        1.0s
 => => extracting sha256:30ec41fb8fedfcefdb27a52e9c73ef6ae7e48d48e544c3dbafc08a91795ca1ec                                 0.0s
 => => sha256:f98450aaa79e55fe594425310a25a3ad86b099437d12bb7ea5d65d577febd66f 43.83MB / 43.83MB                          1.1s
 => => extracting sha256:e5f8ba06cb61cde2aee91c15c4b865821023a80ba36d8d1ba529739563d347a6                                 0.1s
 => => sha256:2ca2eba2194814df994b54cfcbce09d270f2c5c4d825b436e31da119b7b4fca0 604B / 604B                                1.1s
 => => sha256:ff129d3d6d74b94fc13ea0771fb3b99d45f3f9ae8b2daea9166107330cf4c27d 2.68kB / 2.68kB                            1.1s
 => => extracting sha256:5d47f929abda9f4ed6ed1d31458b644e1ef3c9dcf45767b50f4ebed4b6f05645                                 0.6s
 => => sha256:ebe7f681b0164161500057857c69d2f195877714be97cae2d94cb4a7346d1906 4.02kB / 4.02kB                            1.3s
 => => sha256:51d55bf673c12298d16a7f268ec72258276c8b492b4b152cd88303d8a3899188 1.44kB / 1.44kB                            1.2s
 => => sha256:4fee571a1cf586ae0a6f210b9dbb057837a9b10309c6a9f45323d564d06cbd09 3.06kB / 3.06kB                            1.2s
 => => sha256:d033d1656b56c93d3ab3e9a673454ad87ac766fa296e439ce3156eedc8362d06 138.41kB / 138.41kB                        1.3s
 => => sha256:93e64195a1ecc1a3f36a3ece9953a68e5659f5f743512ae0e2e8981bb7d22736 99B / 99B                                  1.4s
 => => sha256:13595d3b00ddccbe1b1bc79afa4551948b8cfb9586d2d4f60a9cabb33b212168 693B / 693B                                1.4s
 => => extracting sha256:f98450aaa79e55fe594425310a25a3ad86b099437d12bb7ea5d65d577febd66f                                 0.6s
 => => extracting sha256:2ca2eba2194814df994b54cfcbce09d270f2c5c4d825b436e31da119b7b4fca0                                 0.0s
 => => extracting sha256:ff129d3d6d74b94fc13ea0771fb3b99d45f3f9ae8b2daea9166107330cf4c27d                                 0.0s
 => => extracting sha256:4fee571a1cf586ae0a6f210b9dbb057837a9b10309c6a9f45323d564d06cbd09                                 0.0s
 => => extracting sha256:ebe7f681b0164161500057857c69d2f195877714be97cae2d94cb4a7346d1906                                 0.0s
 => => extracting sha256:51d55bf673c12298d16a7f268ec72258276c8b492b4b152cd88303d8a3899188                                 0.0s
 => => extracting sha256:d033d1656b56c93d3ab3e9a673454ad87ac766fa296e439ce3156eedc8362d06                                 0.0s
 => => extracting sha256:93e64195a1ecc1a3f36a3ece9953a68e5659f5f743512ae0e2e8981bb7d22736                                 0.0s
 => => extracting sha256:13595d3b00ddccbe1b1bc79afa4551948b8cfb9586d2d4f60a9cabb33b212168                                 0.0s
 => [supabase-grafana grafana  2/11] RUN apt-get update &&     apt-get install -y supervisor jq                           9.4s
 => [supabase-grafana grafana  3/11] COPY --from=prometheus /bin/prometheus /bin/prometheus                               0.1s
 => [supabase-grafana grafana  4/11] COPY --from=prometheus /usr/share/prometheus /usr/share/prometheus                   0.0s
 => [supabase-grafana grafana  5/11] COPY prometheus/prometheus.yml /etc/prometheus/prometheus.yml                        0.0s
 => [supabase-grafana grafana  6/11] COPY prometheus/prometheus.target.yml.tpl /etc/prometheus/prometheus.target.yml.tpl  0.0s
 => [supabase-grafana grafana  7/11] COPY grafana/datasource.yml /etc/grafana/provisioning/datasources/prometheus.yml     0.0s
 => [supabase-grafana grafana  8/11] COPY grafana/dashboard.yml /etc/grafana/provisioning/dashboards/dashboard.yml        0.0s
 => [supabase-grafana grafana  9/11] COPY grafana/dashboard.json /var/lib/grafana/dashboards/dashboard.json               0.0s
 => [supabase-grafana grafana 10/11] COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf                        0.0s
 => [supabase-grafana grafana 11/11] COPY entrypoint.sh /entrypoint.sh                                                    0.0s
 => [supabase-grafana] exporting to image                                                                                 0.4s
 => => exporting layers                                                                                                   0.4s
 => => writing image sha256:15e0b37a3eadad1c435b80564967e0368d6a68e745207dc2c82aae7bb11ca7bf                              0.0s
 => => naming to docker.io/library/supabase-grafana-supabase-grafana                                                      0.0s
[+] Running 2/1
 ✔ Network supabase-grafana_default               Created                                                                 0.1s
 ✔ Container supabase-grafana-supabase-grafana-1  Created                                                                 0.0s
Attaching to supabase-grafana-1
supabase-grafana-1  | exec /entrypoint.sh: no such file or directory
supabase-grafana-1 exited with code 1

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Follow the ReadMe directions for running locally
  2. See error

Expected behavior

I expect the docker containers to run.

System information

Additional context

Resolution was to run dos2unix entrypoint.sh, clear build caches, and re-run with docker compose up --build to force the rebuild.

pcnc commented 10 months ago

Hi @Gipetto - thanks for reporting this!

Will investigate - in the meantime, to help narrow-down on any edge-cases, could you also provide the Docker runtime version used to build the image?

Gipetto commented 10 months ago

Sure thing.

$ docker info
Client:
 Version:    24.0.5
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.11.2
    Path:     /nix/store/gdyxcsv9w1aghvgjy1j4c4mmdh35hi93-docker-plugins/libexec/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  2.23.1
    Path:     /nix/store/gdyxcsv9w1aghvgjy1j4c4mmdh35hi93-docker-plugins/libexec/docker/cli-plugins/docker-compose

Server:
 Containers: 11
  Running: 11
  Paused: 0
  Stopped: 0
 Images: 16
 Server Version: 24.0.5
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: journald
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc io.containerd.runc.v2
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: v1.7.9
 runc version:
 init version:
 Security Options:
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 6.6.3
 Operating System: NixOS 23.11 (Tapir)
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 31.14GiB
 Name: ****
 ID: ********-****-****-****-************
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: *******
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
rbkayz commented 7 months ago

Facing a similar issue. Any update here

rbkayz commented 7 months ago

@Gipetto @pcnc - hi. Any luck on solving this?

pcnc commented 6 months ago

@rbkayz unfortunately we were not able to reproduce the problem across Ubuntu, NixOS, and MacOS. Using dos2unix across these systems doesn't seem to modify the file whatsoever - does it modify the file at all on your machine?

Curious if this a git config-related issue. Would you mind checking the value returned by git config --get core.autocrlf?

bukinoshita commented 6 months ago

The error when trying to deploy to fly.io

CleanShot 2024-04-18 at 15 46 16@2x

Gipetto commented 6 months ago

@pcnc I do definitely use autocrlf in git.

$ git config --get core.autocrlf
true
pcnc commented 5 months ago

@Gipetto @rbkayz - just merged a fix to ensure that the entrypoint is flagged as executable during the build step.

A bit of a long shot but given we couldn't reproduce it on our end, wondering if this does address the issue on yours.

rbkayz commented 5 months ago

Thanks a lot. Let me check this and get back

ethan-davies commented 4 months ago

In my use case, these changes don't seem to affect the issue as I'm still receiving the issue:

supabase-grafana-1  | exec /entrypoint.sh: no such file or directory
ethan-davies commented 4 months ago

I just did some more digging and I managed to fix this issue by converting the line endings. Try doing the following:

darora commented 3 months ago

Am closing this per #28

Am relying upon @ethan-davies 's assertion that it fixes the issue. I haven't been able to reproduce it, so lmk if it's still not fixed and we can re-open it.