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

[BUG] Raspberry Pi ARM Architecture Problem with DB #431

Open
greg121 opened this issue Jan 9, 2025 · 6 comments
Open

[BUG] Raspberry Pi ARM Architecture Problem with DB #431

greg121 opened this issue Jan 9, 2025 · 6 comments
Labels
bug Something isn't working

Comments

@greg121
Copy link

greg121 commented Jan 9, 2025

Describe the bug
database not working on Rapberry Pi

To Reproduce
Install on Raspberry Pi

Expected behavior
working Adventurelog

Screenshots
no screenshots

Docker Compose
as provided from the documentation

Additional context
"Supported architecture: amd64 (also known as X86-64)" from the postgis github repo

 ! db The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested 0.0s
 ✔ Container adventurelog-backend                                                                                                                    Started5.8s
 ✔ Container adventurelog-frontend                                                                                                                   Started3.8s
user@raspberrypi:~/adventurelog $ docker logs adventurelog-db
exec /usr/local/bin/docker-entrypoint.sh: exec format error

@greg121 greg121 added the bug Something isn't working label Jan 9, 2025
@greg121
Copy link
Author

greg121 commented Jan 9, 2025

anyone got it working on Raspberry Pi?

@seanmorley15
Copy link
Owner

Hi! AdventureLog is compatible with ARM but unfortunately the PostGIS DB is not right now. The workaround is to use a community image that has support form ARM. I recommend using this image for the DB tobi312/rpi-postgresql-postgis:13-3.3-alpine-arm. Here is a link to the recommended ARM compose. Let me know how this goes, if it works well I will add it to the docs :)

@greg121
Copy link
Author

greg121 commented Jan 10, 2025

thanks for the effort. tried several versions of it. couldnt get it running. could not sign up a new user. no error in logs unfortuneatly

@seanmorley15
Copy link
Owner

@greg121, can you possibly send your docker compose file so I can help debug, also a screenshot of the backend logs even if there are no errors displayed? I would also double check the network tab of the browser console when trying to sign up or login to see why the request is failing

@seanmorley15 seanmorley15 moved this to In review in AdventureLog Roadmap Jan 11, 2025
@jenkshields
Copy link

I'm running into the same issue, too. I've attached my compose file - I'm using caddy to reverse proxy adventurelog locally. I get a 500 error in the browser and the following error from the frontend container:

TypeError: fetch failed
    at node:internal/deps/undici/undici:12618:11
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async fetchCSRFToken (file:///app/build/server/chunks/index.server-CBG1QNm5.js:4:26)
    at async default (file:///app/build/server/chunks/11-C3s4xmRR.js:28:23)
    at async handle_action_json_request (file:///app/build/server/index.js:992:18)
    at async resolve2 (file:///app/build/server/index.js:3715:24)
    at async i18nHook (file:///app/build/server/chunks/hooks.server-DhCGhSN5.js:95:12)
    at async themeHook (file:///app/build/server/chunks/hooks.server-DhCGhSN5.js:90:10)
    at async authHook (file:///app/build/server/chunks/hooks.server-DhCGhSN5.js:38:14)
    at async respond (file:///app/build/server/index.js:3607:22) {
  cause: Error: connect ECONNREFUSED 192.168.48.3:8000
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) {
    errno: -111,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '192.168.48.3',
    port: 8000
  }
}

It looks like the backend container isn't reachable from the frontend, but this might be an issue with my compose - I had to tweak it a little to remove the nginx config, and I wasn't sure which ports needed to align in this one vs the compose file listed in the docs. Appreciate your help!

Compose:

services:
  web:
    image: ghcr.io/seanmorley15/adventurelog-frontend:latest
    platform: linux/arm64
    container_name: adventurelog-frontend
    restart: unless-stopped
    environment:
      - PUBLIC_SERVER_URL=http://adventurelog-backend:8000
      - ORIGIN=https://adventure.whare
      - BODY_SIZE_LIMIT=Infinity
    ports:
      - "7000:3000"
    depends_on:
      - server

  db:
    image: tobi312/rpi-postgresql-postgis:13-3.3-alpine-arm
    platform: linux/arm64
    container_name: adventurelog-db
    restart: unless-stopped
    environment:
      POSTGRES_DB: database
      POSTGRES_USER: adventure
      POSTGRES_PASSWORD: adventure
    volumes:
      - postgres_data:/var/lib/postgresql/data/

  server:
    image: ghcr.io/seanmorley15/adventurelog-backend:latest
    platform: linux/arm64
    container_name: adventurelog-backend
    restart: unless-stopped
    environment:
      - PGHOST=db
      - PGDATABASE=database
      - PGUSER=adventure
      - PGPASSWORD=adventure
      - SECRET_KEY=+gHIbzNHb9mEYxzF5oP8yxpzRbOQtBbe/yhrZu4qh019NUZ1
      - DJANGO_ADMIN_USERNAME=adventure
      - DJANGO_ADMIN_PASSWORD=adventure
      - [email protected]
      - PUBLIC_URL='http://localhost:8016'
      - CSRF_TRUSTED_ORIGINS=https://api.adventurelog.app,https://adventurelog.app,http://localhost:7000,http://192.168.0.185:7000,https://adventure.whare
      - DEBUG=False
      - FRONTEND_URL='https://adventure.whare'
    ports:
      - "8000:8000"
    depends_on:
      - db
    volumes:
      - adventurelog_media:/code/media/

volumes:
  postgres_data:
  adventurelog_media:

@seanmorley15
Copy link
Owner

seanmorley15 commented Jan 12, 2025

Hi! try changing PUBLIC_SERVER_URL=http://adventurelog-backend:8000 to PUBLIC_SERVER_URL=http://server:8000 because it connects on the service name typically not container name. Other than that this looks good - note that if you are exposing the frontend but not the backend using the reverse proxy you will most likely run into issues with media files like images being served properly. Also make sure that the ports for the server are 8000:80 where 80 is the internal port

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: In review
Development

No branches or pull requests

3 participants