Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

500 Internal Error #51

Open
basings opened this issue Apr 9, 2024 · 5 comments
Open

500 Internal Error #51

basings opened this issue Apr 9, 2024 · 5 comments

Comments

@basings
Copy link

basings commented Apr 9, 2024

Description

I tried to run the container but http://ip:3000 returns 500 Internal Error.

Following is the output in terminal

podman start -a wanderer-search
ls: /meili_data/data.ms/indexes: No such file or directory
error: invalid value 'True' for '--no-analytics'
  [possible values: true, false]

  tip: a similar value exists: 'true'

For more information, try '--help'.
podman start -a wanderer-db
ERRO[0000] Failed to start transient timer unit: Unit 0508fd13820c91db6349a87c0b986f9b81a74b4a940d1cdb77af92e511b5b8ed.timer was already loaded or has a fragment file. 
[db]     | 2024/04/09 05:43:01 Server started at http://0.0.0.0:8090
[db]     | ├─ REST API: http://0.0.0.0:8090/api/
[db]     | └─ Admin UI: http://0.0.0.0:8090/_/
podman start -a wanderer-web
ERRO[0000] Failed to start transient timer unit: Unit 0508fd13820c91db6349a87c0b986f9b81a74b4a940d1cdb77af92e511b5b8ed.timer was already loaded or has a fragment file. 
[web]    | Listening on 0.0.0.0:3000

I created the missing file /meili_data/data.ms/indexes manually and started the container again.

podman start -a wanderer-search
ERRO[0000] Failed to start transient timer unit: Unit 2fb5f2edeab02bafcfec7f2e86420887286d552f482fe6b6876dae69c9a30bfc.timer was already loaded or has a fragment file. 
error: invalid value 'True' for '--no-analytics'
  [possible values: true, false]

  tip: a similar value exists: 'true'

For more information, try '--help'.
podman start -a wanderer-db
ERRO[0000] Failed to start transient timer unit: Unit 2fb5f2edeab02bafcfec7f2e86420887286d552f482fe6b6876dae69c9a30bfc.timer was already loaded or has a fragment file. 
[db]     | 2024/04/09 05:56:20 Server started at http://0.0.0.0:8090
[db]     | ├─ REST API: http://0.0.0.0:8090/api/
[db]     | └─ Admin UI: http://0.0.0.0:8090/_/
podman start -a wanderer-web

Device specific Info

  • Remote server. (not localhost)
  • Operating system: fedora atomic
  • podman
  • selinux

Reproduction steps

  1. ssh user:host
  2. wget https://raw.githubusercontent.com/Flomp/wanderer/main/docker-compose.yml
  3. modify docker-compose.yml
    2.1. add :Z to all paths to account for selinux.
    2.2. change localhost to ip addr of server
  4. podman compose up
@Flomp
Copy link
Owner

Flomp commented Apr 9, 2024

Thanks for your report.
The indexes folder should be created upon the first startup of the wanderer-search container. meilisearch will create two indices from a dump when you start it for the first time and store them in the indexes folder. I suspect this did not work in your case and that's why you get the No such file or directory error. Simply creating a file with the same name won't fix this issue because meilisearch will simply not start. Hence your second attempt is failing.

Unfortunately, I am very unfamiliar with your setup (both selinux & podman), so debugging why the index creation failed will be a bit tricky. Does the wanderer-search container have any internal logs? Do you have sufficient permissions on the folder you are trying to mount to?

@basings
Copy link
Author

basings commented Apr 9, 2024

thx.

I tested disabling selinux with setenforce 0 if it is selinux-related but it isn't. You must be right with the permission yet

It looks like it's permission related since wanderer-search can't ls the files. Yet, if I use named volumes it doesn't work either. To my understanding a permission problem on the host should not be a problem with named volumes. Either the meilisearch --import-dump /meili_data/dumps/migration.dump fails, or copying doesn't work before that COPY ./migrations/migration.dump /meili_data/dumps/migration.dump.

I don't get enough logs for it.

@basings
Copy link
Author

basings commented Apr 9, 2024

When I try to build it locally, I get

$ podman build db
STEP 1/11: FROM alpine:3.16
STEP 2/11: WORKDIR /
--> Using cache 7a95637707d435b3c997d06bd357bd6463034d8c50cd90631df84c3c8a000335
--> 7a95637707d4
STEP 3/11: COPY migrations ./migrations
--> Using cache a59012ed412990c5ffae0e5780940df360ea46c0530b7a9b2853e41ebf244b13
--> a59012ed4129
STEP 4/11: ARG TARGETARCH
--> Using cache d2a378b64f868c877f5b351c02f44ace1eb8b8fba9d892c672dbde9aae31f3d3
--> d2a378b64f86
STEP 5/11: RUN echo ${TARGETARCH}
--> Using cache dc3c90eabf70b5d1382e38ca695dd4076fcc03787d002c8222dd38dcbe247ad5
--> dc3c90eabf70
STEP 6/11: COPY ./pocketbase_${TARGETARCH} /pocketbase
Error: building at STEP "COPY ./pocketbase_${TARGETARCH} /pocketbase": checking on sources under "/wanderer/db": copier: stat: "/pocketbase_amd64": no such file or directory

comparable outputs for the other two containers it looks like I was too quick. search yields something.

$ podman build web
STEP 1/17: FROM node:18-alpine
STEP 2/17: WORKDIR /app
--> Using cache c261f4fdc5ea36056b8a58722fa5037364323d3601ee0204d8b35fc62c868b44
--> c261f4fdc5ea
STEP 3/17: COPY ./build build/
Error: building at STEP "COPY ./build build/": checking on sources under "/wanderer/web": copier: stat: "/build": no such file or directory
$ podman build search
STEP 1/5: FROM getmeili/meilisearch:v1.6.2
STEP 2/5: COPY ./migrations/migration.dump /meili_data/dumps/migration.dump
--> Using cache 580899b1c1ee3270bb6c44ae7b74fcc7db04bbcbddc9fb33243f82770d50cc3e
--> 580899b1c1ee
STEP 3/5: COPY ./entrypoint.sh /entrypoint.sh
--> Using cache 49d4e706202a6a43049178b66cf7e99dcf4d246b8ec567dbc981de197888b16b
--> 49d4e706202a
STEP 4/5: RUN chmod +x /entrypoint.sh
--> Using cache 95b23c516322c41973dc5a9d9c93ee299e50f3844565bfe9f71150666776f044
--> 95b23c516322
STEP 5/5: CMD [ "/entrypoint.sh" ]
--> Using cache d2bc5669cf14759cfde9a94ab0ad13d0ce1819856c8fed1fcf4fb7c65d6610b3
--> d2bc5669cf14
d2bc5669cf14759cfde9a94ab0ad13d0ce1819856c8fed1fcf4fb7c65d6610b3

yet it returns the same error that it can't find the files.

@Flomp
Copy link
Owner

Flomp commented Apr 13, 2024

Yes, for speed reasons the PocketBase binary is not built in the docker build process itself. Similarly, the svelte application is also not built during docker build. Rather you would need to build them on your own machine. You can read about the process here.

@jo-chemla
Copy link

jo-chemla commented May 16, 2024

I stumbled on the same 500-internal-error when trying to setup wanderer for the first time using the example root docker-compose.yml and trying multiple iterations based on the existing guides for installation and configuration.

Since I've already got quite a lot of services with ports already allocated, I tried to remap the container/host ports, which might be the source of confusion for my setup:

Here is one attempt docker-compose where I did set:

version: "3.5"
services:
#----------------------------- WANDERER GPX tracks ---------------------------------#
  wanderer-search:
    container_name: wanderer-search
    image: flomp/wanderer-search:latest
    environment:
      MEILI_URL: http://wanderer-search:7700
      MEILI_MASTER_KEY: vODkljPcfFANYNepCHyDyGjzAMPcdHnrb6X5KyXQPWo
      MEILI_NO_ANALYTICS: true
    ports:
      - 7700:7700
    networks:
      - wanderer
    volumes:
      - /share/config/frontends/wanderer/data/data.ms:/meili_data/data.ms
    restart: unless-stopped
    healthcheck:
      test: curl --fail http://wanderer-search:7700/health || exit 1
      interval: 15s
      retries: 10
      start_period: 20s
      timeout: 10s
  wanderer-db:
    container_name: wanderer-db
    image: flomp/wanderer-db:latest
    depends_on:
      wanderer-search:
        condition: service_healthy
    ports:
      - 18090:8090
    networks:
      - wanderer
    restart: unless-stopped
    volumes:
      - /share/config/frontends/wanderer/data/pb_data:/pb_data
  wanderer-web:
    container_name: wanderer-web
    image: flomp/wanderer-web:latest
    depends_on:
      wanderer-search:
        condition: service_healthy
      wanderer-db:
        condition: service_started
    environment:
      # ORIGIN: http://localhost:3000
      ORIGIN: http://nas-hostname:13000
      BODY_SIZE_LIMIT: Infinity
      PUBLIC_POCKETBASE_URL: http://wanderer-db:8090
      # PUBLIC_POCKETBASE_URL: http://local-ip:18090
      # PUBLIC_POCKETBASE_URL: http://hostname:18090
      PUBLIC_DISABLE_SIGNUP: false
      # UPLOAD_FOLDER: /app/uploads
      # UPLOAD_USER: Flomp
      # UPLOAD_PASSWORD: 12345678
      # PUBLIC_VALHALLA_URL: https://valhalla1.openstreetmap.de
    volumes:
      - /share/config/frontends/wanderer/data/uploads:/app/uploads
    ports:
      - 13000:3000
    networks:
      - wanderer
    restart: unless-stopped

networks:
  wanderer:
    driver: bridge

From the logs

  • Meilisearch/wanderer-search seem to be running fine,
  • wanderer-db pocketbase seem to be unable to communicate with meiliesearch, but I cannot find editable env variables which would allow me to point it to the right service:
  • wanderer-web has a failed fetch, see logs below.

Note my 8090 port is already used by services other than wanderer, which might be the root cause of the issue because I'm using a network-bridge mode. I also tried to use another network mode, but could not find the right compose setup that would succeed. Any pointer would be very much appreciated!

# wanderer-db logs
2024/05/16 18:57:44 MeilisearchCommunicationError unable to execute request (path "GET /keys" with method "GetKeys"): dial tcp4 127.0.0.1:7700: connect: connection refused
2024/05/16 18:57:46 Server started at http://0.0.0.0:8090
├─ REST API: http://0.0.0.0:8090/api/
└─ Admin UI: http://0.0.0.0:8090/_/

# wanderer-web logs 1
19:30:00: Starting auto-upload
TypeError: fetch failed
    at node:internal/deps/undici/undici:12618:11 {
  cause: SocketError: other side closed
      at Socket.onSocketEnd (node:internal/deps/undici/undici:9169:26)
      at Socket.emit (node:events:529:35)
      at endReadableNT (node:internal/streams/readable:1400:12)
      at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
    code: 'UND_ERR_SOCKET',
    socket: {
      localAddress: '172.29.20.45',
      localPort: 59478,
      remoteAddress: '192.168.2.10',
      remotePort: 18090,
      remoteFamily: 'IPv4',
      timeout: undefined,
      bytesWritten: 220,
      bytesRead: 0
    }
  }
}
19:30:01: Login failed. Unable to obtain cookie.

# wanderer-web logs 2
Listening on 0.0.0.0:3000
TypeError: fetch failed
    at node:internal/deps/undici/undici:12618:11 {
  cause: SocketError: other side closed
      at Socket.onSocketEnd (node:internal/deps/undici/undici:9169:26)
      at Socket.emit (node:events:529:35)
      at endReadableNT (node:internal/streams/readable:1400:12)
      at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
    code: 'UND_ERR_SOCKET',
    socket: {
      localAddress: '172.29.20.45',
      localPort: 40418,
      remoteAddress: '172.29.20.41',
      remotePort: 8090,
      remoteFamily: 'IPv4',
      timeout: undefined,
      bytesWritten: 219,
      bytesRead: 0
    }
  }
}
TypeError: fetch failed
    at node:internal/deps/undici/undici:12618:11
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  cause: Error: getaddrinfo ENOTFOUND wanderer-db
      at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:107:26) {
    errno: -3008,
    code: 'ENOTFOUND',
    syscall: 'getaddrinfo',
    hostname: 'wanderer-db'
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants