johanohly/AirTrail

Cannot login after update

Closed this issue · 2 comments

The bug

So i'm going to start this off by stating that i'm not a developer, and most of the time, i've poking around in the dark with this kind of stuff.

I followed this guide on how to install Airtrail via portainer on my NAS. It worked beautifully
https://mariushosting.com/how-to-install-airtrail-on-your-synology-nas/

So, I saw the update and thought, ok, I can just stop the stack, and re-pull and redeploy the image, right? So I did and it's all running and I have the front end, but nothing happens when I enter my login details and try to login.

So then I noticed some steps here:
https://johanohly.github.io/AirTrail/docs/install/updating

Firstly, I was like, what the hell is bun and where am I meant to run these commands?

So, I attached a console to the AirTrail container as root, starting from the bun install command. I had to trust I think 6 packages, and then everything was good.

However, when I get to the build stage, I get an error.

root@41aa629dc98e:/app# bun run build
$ vite build
vite v5.3.5 building for production...
✓ 0 modules transformed.
x Build failed in 38ms
error during build:
Could not resolve entry module "index.html".
    at getRollupError (/app/node_modules/rollup/dist/es/shared/parseAst.js:392:45)
    at error (/app/node_modules/rollup/dist/es/shared/parseAst.js:388:42)
    at processTicksAndRejections (:12:39)
error: script "build" exited with code 1
root@41aa629dc98e:/app# 

If i try to update the db via root or regular user

bun@41aa629dc98e:/app$ bun run db:migrate
$ prisma migrate deploy
/bin/bash: line 1: prisma: command not found
error: script "db:migrate" exited with code 127
bun@41aa629dc98e:/app$ 

If I then restart the container or stack, it appears to run fine with no errors.

    
Applying migrations...

Resolving dependencies

Resolved, downloaded and extracted [26]

Saved lockfile

Prisma schema loaded from prisma/schema.prisma

Datasource "db": PostgreSQL database "airtrail", schema "public" at "db:5432"

5 migrations found in prisma/migrations

No pending migrations to apply.

Starting server...

Listening on 0.0.0.0:3000

Applying migrations...

Prisma schema loaded from prisma/schema.prisma

Datasource "db": PostgreSQL database "airtrail", schema "public" at "db:5432"

5 migrations found in prisma/migrations

No pending migrations to apply.

Starting server...

Listening on 0.0.0.0:3000

I visit the frontend, and the same issue, I can't login.

Where am I going wrong please?

Operating System that is running AirTrail

Docker

AirTrail Version

0.2.0

Your docker-compose.yml content

services:
  db:
    image: postgres:16
    container_name: AirTrail-DB
    hostname: airtrail-db
    mem_limit: 1g
    cpu_shares: 1024
    security_opt:
      - no-new-privileges:true
    healthcheck:
      test: ["CMD", "pg_isready", "-q", "-d", "airtrail", "-U", "airtrailuser"]
      timeout: 45s
      interval: 10s
      retries: 10
    volumes:
      - /volume1/docker/airtraildb:/var/lib/postgresql/data:rw
    environment:
      POSTGRES_DB: airtrail
      POSTGRES_USER: airtrailuser
      POSTGRES_PASSWORD: airtrailpass
    restart: on-failure:5

  airtrail:
    image: johly/airtrail:latest
    container_name: AirTrail
    restart: on-failure:5
    healthcheck:
      test: timeout 10s bash -c ':> /dev/tcp/127.0.0.1/3000' || exit 1
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 90s
    environment:
      - ORIGIN=https://airtrail.chroma.london
      - DB_URL=postgres://airtrailuser:airtrailpass@db:5432/airtrail
      - DB_DATABASE_NAME=airtrail
      - DB_USERNAME=airtrail
      - DB_PASSWORD=xxxx
    ports:
      - 3857:3000
    depends_on:
      db:
        condition: service_healthy

Your .env content

No response

Reproduction steps

See above

Relevant log output

No response

Additional information

No response

I actually think this is unrelated to airtrail.

Earlier when I was trying to do this, it was on a local IP to my NAS. I have a reverse proxy setup on the NAS as well as an A record from my domain pointing to it specifically for airtrail with a HTTPS certificate.

When using it locally, obviously this certificate isn't active.

When connecting from outside of that local network, I can login, and everything is working fine.

I am happy to hear it is working now!
Yes, that sounds like a CORS error. It should say in the browser console, but it is totally fair you didn't check it.
Just for clarification, the part of the updating doc you referenced is for manual installs (e.g. without docker)