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] adventurelog-backend Error starting nginx #366

Closed
kceleslie opened this issue Nov 17, 2024 · 4 comments
Closed

[BUG] adventurelog-backend Error starting nginx #366

kceleslie opened this issue Nov 17, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@kceleslie
Copy link

Describe the bug
Just upgraded to 0.7.1 and the adventurelog-backend wont start. I'm getting an error "Starting nginx: nginx failed"

To Reproduce
Steps to reproduce the behavior:

  1. Run the server

Expected behavior
Server starts

Screenshots
If applicable, add screenshots to help explain your problem.

Docker Compose
I'm running mine within k3s, which i understand is probably not a supported. I'll paste my config and it's probably something i've got wrong. But it did work on previous versions. It would be helpful if i could get more logs to help pinpoint the problem.

apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: adventurelogserver
  name: adventurelogserver
spec:
  replicas: 1
  selector:
    matchLabels:
      app: adventurelogserver
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: adventurelogserver
    spec:
      #securityContext:
      #  runAsUser: 1000
      #  runAsGroup: 1000
      containers:
        - env:
          - name: TZ
            value: "America/Chicago"
          - name: PGHOST
            value: "adventurelogdb"
          - name: PGDATABASE
            value: database
          - name: PGUSER
            value: "adventurelog"
          - name: PGPASSWORD
            value: "xxxxxxxxxx"
          - name: SECRET_KEY
            value: xxxxxxx
          - name: DJANGO_ADMIN_USERNAME
            value: xxxxxxxxxx                                                                                                                        
          - name: DJANGO_ADMIN_PASSWORD
            value: xxxxxxxxxxxxxxxxxx                                                                                                                        
          - name: DJANGO_ADMIN_EMAIL
            value: [email protected]
          - name: PUBLIC_URL
            value: 'http://trips.xxxxxxxxxxxxx.xyz'                            
          - name: CSRF_TRUSTED_ORIGINS
            value: "http://trips.xxxxxxxxxxx.xyz,http://0.0.0.0:8080"
          - name: DEBUG
            value: "True"
          - name: FRONTEND_URL
            value: 'http://trips.xxxxxxxxxxxxxxxx.xyz'
          image: ghcr.io/seanmorley15/adventurelog-backend:latest
          name: adventurelog
          ports:
            - containerPort: 80
          #  - containerPort: 22
          volumeMounts:
            - mountPath: /code/media
              name: adventurelog-nfs
            #- mountPath: /old
            #  name: adventurelog-nfs
          #securityContext:
          #  allowPrivilegeEscalation: false
      restartPolicy: Always
      volumes:
        - name: adventurelog-nfs
          nfs:
            server: 192.168.1.120
            path: /volume1/kubernetes/adventurelog/server

Additional context
Add any other context about the problem here.

@kceleslie kceleslie added the bug Something isn't working label Nov 17, 2024
@seanmorley15
Copy link
Owner

Hi @kceleslie, I think this is an issue with the nginx config. The default config expects the server service to be named server so that it can be accessed on http://server:8000. I do not know about k3s but it seems like adventurelogserver should be named server. This can be customized if you get a copy of the nginx conf used, found here: https://github.com/seanmorley15/AdventureLog/blob/main/backend/nginx.conf. Then mount it into the container at /etc/ngninx/nginx.conf, changing any reference to "server" with your desired service name.

@seanmorley15 seanmorley15 self-assigned this Nov 17, 2024
@kceleslie
Copy link
Author

Thanks, that seems to have resolved that issue. Having other issues now but i think it's on my end.

@perry-mitchell
Copy link

perry-mitchell commented Jan 10, 2025

@seanmorley15 / @kceleslie Would you consider reopening this? It's definitely a bug in my opinion. The nginx config should not have any sway on the naming of the backend service/host, especially considering that it's required to be separate from the front-end. Ultimately I think having them combined in a single container would be tidier, but this would be a good first step in making this config more friendly for those running it on a cluster (like myself).

@seanmorley15
Copy link
Owner

No worries @perry-mitchell! Just about to release a quick fix using some docker networking tricks to fix the issue!

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
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants