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

Please Help - Installation via Docker, cannot create event #150

Closed
superdingo101 opened this issue May 11, 2024 · 5 comments
Closed

Please Help - Installation via Docker, cannot create event #150

superdingo101 opened this issue May 11, 2024 · 5 comments

Comments

@superdingo101
Copy link

Hello, I have installed my instance via docker on a NAS and am struggling to get it up and running.

Ultimately, the error message isn't specific enough to help me troubleshoot it on my own.

A note on my config and things I have tried:

  • My NAS is a Terramaster F4-423 with Intel® Celeron® N5095, which is why I am specifying mongo version 4.4 (version 5 and greater requires AVX, see: Mongo 5.0.0 crashes but 4.4.6 works docker-library/mongo#485 (comment))
  • I have queried the database using MongoDB Compass application and can see the gathdb database and the startup message is logged succesfully, i.e. I see the following in the database:
status: "success"
process: "startup"
message: "Started up successfully"
  • I tried a fresh install on a raspberry pi 4 which had similar mongo constraints for CPU architecture with the same end result and same error message
  • I edited the Dockerfile to comment out RUN cp config/config.example.toml config/config.toml as it kept overwriting my config file with the default config settings

docker-compose.yml:

services:
    gathio:
        build: .
        ports:
            - 3000:3000
    mongo:
        ports:
            - 3009:27017
        volumes:
            - mongo-data:/data/db
        image: mongo:4.4

volumes:
    mongo-data:

Dockerfile

FROM node:18-alpine
WORKDIR /app
RUN apk add --no-cache python3 build-base
ADD package.json pnpm-lock.yaml /app/
RUN npm install -g pnpm
RUN pnpm install
COPY . /app/
# RUN cp config/config.example.toml config/config.toml
# Always exit 0 here because TSC will fail while we're migrating to TypeScript but
# not everything uses TypeScript
RUN pnpm run build; exit 0
CMD pnpm run start

config.toml:

[general]
# Your domain goes here. If there is a port it should be 'domain.com:port', but
# otherwise just 'domain.com'.
domain = "192.168.0.99:3000"
port = "3000"
email = "[redacted]"
site_name = "Events!"
is_federated = false
# Events will be deleted this many days after they have ended. Set to 0 to
# disable automatic deletion (old events will never be deleted).
delete_after_days = 0
# If left blank, this defaults to
# https://yourdomain.com/images/gathio-email-logo.gif. Set a full URL here to
# change it to your own logo (or just change the file itself).
email_logo_url = ""
# Show a Ko-Fi box to donate money to Raphael (Gathio's creator) on the front
# page.
show_kofi = false
# Show a list of events and groups on the front page which have been marked as
# 'Display this event/group on the public event/group list'.
show_public_event_list = false
# Which mail service to use to send emails to hosts and attendees. Options are
# 'nodemailer' or 'sendgrid'. Configure settings for this mail
# service below.
mail_service = "sendgrid"
# An array of email addresses which are permitted to create events. If this is
# empty, anyone can create events.
# For example:
# creator_email_addresses = ["[email protected]", "[email protected]"]
creator_email_addresses = []

[database]
# Set up for a locally running MongoDB connection. Change this to
# 'mongodb://mongo:27017/gathio' for a Dockerised connection.
mongodb_url = "mongodb://192.168.0.99:3009/gathdb"

[nodemailer]
smtp_server = ""
smtp_port = ""
smtp_username = ""
smtp_password = ""

[sendgrid]
api_key = "[redacted]"

# Links to static pages (for example a privacy policy) or an external community page,
# which will be displayed in the footer.
# If paths begin with a slash, they are treated as internal and will open the specified
# Markdown or text file. If they are absolute (begin with https://), they will simply
# link to the specified URL.

[[static_pages]]
title = "Privacy Policy"
path = "/privacy"
filename = "privacy-policy.md"

# [[static_pages]]
# title = "External Link"
# path = "https://example.com"

error message: https://imgur.com/MKYZQrf

Result of docker logs gathio-gathio-1:

> [email protected] start /app
> node dist/start.js

Sendgrid is ready to send emails.
Sendgrid is ready to send emails.
Welcome to gathio! The app is now running on http://localhost:3000
Mongoose connection open!
@lowercasename
Copy link
Owner

Hm, it's really odd that everything starts up successfully but the server just mysteriously fails. I'll see if I can replicate this!

@HybridSarcasm
Copy link
Contributor

HybridSarcasm commented Jun 27, 2024

I can replicate. My setup is pretty vanilla, too. I'm using nodemailer, instead of SendGrid, though.

services:
    gathio:
        build: .
        links:
            - mongo
        ports:
            - 3000:3000

    mongo:
        image: mongo:latest
        volumes:
            - /docker/data/gathio/mongodb_data_db:/data/db
> [email protected] start /app
> node dist/start.js

Welcome to gathio! The app is now running on http://localhost:3000
Mongoose connection open!

@lowercasename
Copy link
Owner

lowercasename commented Jul 1, 2024

I still can't replicate, although at the moment the only machine I have access to is an M1 MacBook, which I don't think is necessarily the best testing machine for this. I have however just made some commits which have pushed the Node version to 20 and removed that COPY line for the config file in the Dockerfile. Instead I've set up a volume mount in the default docker-compose.yml file, which makes a lot more sense. I've also now made the default mail service 'none', which means no emails will be sent. None of these are changes that I think will fix this, but I'm still investigating!

@eprouty-chwy
Copy link

Setting is_federated=false in the config is how you replicate this. The server works if that's set to true but otherwise fails with 404 responses to /event calls.

@lowercasename for vis 👀

@lowercasename
Copy link
Owner

Oh well done - I've fixed this! It was a pretty egregious bug in the ActivityPub router which made all routes listed after that router to return 404 when ActivityPub was disabled.

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

4 participants