Service fails to start, complains about server_name not being set #392

Open
opened 2023-10-03 16:22:03 +00:00 by desultory1 · 4 comments
desultory1 commented 2023-10-03 16:22:03 +00:00 (Migrated from gitlab.com)

I've created a LXC container, and have the following config:

lxc.init.uid = 249
lxc.init.gid = 249
lxc.environment = RUST_BACKTRACE=1
lxc.environment = CONDUIT_CONFIG="/etc/conduit/conduit.toml"
lxc.init.cmd = /usr/bin/tini /usr/bin/conduit

The container fails to start with:

It looks like your config is invalid. The following error occurred: missing field `server_name`

This is set. Changing the path to a nonexistent file does not throw any different error. Breaking the config doesn't throw a different error. As far as i can tell it's reading some default and disregarding my config file.

Why can't i just pass it as a parameter?

I've created a LXC container, and have the following config: ``` lxc.init.uid = 249 lxc.init.gid = 249 lxc.environment = RUST_BACKTRACE=1 lxc.environment = CONDUIT_CONFIG="/etc/conduit/conduit.toml" lxc.init.cmd = /usr/bin/tini /usr/bin/conduit ``` The container fails to start with: ``` It looks like your config is invalid. The following error occurred: missing field `server_name` ``` This is set. Changing the path to a nonexistent file does not throw any different error. Breaking the config doesn't throw a different error. As far as i can tell it's reading some default and disregarding my config file. Why can't i just pass it as a parameter?
Aranjedeath commented 2023-10-03 16:28:11 +00:00 (Migrated from gitlab.com)

confirm conduit inside the container can actually read that file. config invalid because of missing term is usually file path or permissions issue. you can pass all details via environment variables if you prefer, see: docker deploy directions for the list

confirm conduit inside the container can actually read that file. config invalid because of missing term is usually file path or permissions issue. you can pass all details via environment variables if you prefer, see: [docker deploy directions](https://gitlab.com/famedly/conduit/-/tree/next/docker) for the list
desultory1 commented 2023-10-03 16:37:55 +00:00 (Migrated from gitlab.com)

if I run unshare and map to the same user the container uses, I can read the file fine.

lxc-conduit@amazon ~/.local/share/lxc/conduit $ ls -lan rootfs/etc/conduit/conduit.toml 
-rw-r--r--. 1 493216 493216 2119 Oct  3 11:08 rootfs/etc/conduit/conduit.toml
lxc-conduit@amazon ~/.local/share/lxc/conduit $ cat /etc/subuid | grep conduit
lxc-conduit:493216:65536
lxc-conduit@amazon ~/.local/share/lxc/conduit $ unshare --user --map-user 249 --map-group 249
I have no name!@amazon ~/.local/share/lxc/conduit $ file rootfs/etc/conduit/conduit.toml 
rootfs/etc/conduit/conduit.toml: ASCII text
I have no name!@amazon ~/.local/share/lxc/conduit $ 

What I find most concerning is that I'm getting an error about some missing field but it doesn't seem to be reading the file at all.

if I run unshare and map to the same user the container uses, I can read the file fine. ``` lxc-conduit@amazon ~/.local/share/lxc/conduit $ ls -lan rootfs/etc/conduit/conduit.toml -rw-r--r--. 1 493216 493216 2119 Oct 3 11:08 rootfs/etc/conduit/conduit.toml lxc-conduit@amazon ~/.local/share/lxc/conduit $ cat /etc/subuid | grep conduit lxc-conduit:493216:65536 lxc-conduit@amazon ~/.local/share/lxc/conduit $ unshare --user --map-user 249 --map-group 249 I have no name!@amazon ~/.local/share/lxc/conduit $ file rootfs/etc/conduit/conduit.toml rootfs/etc/conduit/conduit.toml: ASCII text I have no name!@amazon ~/.local/share/lxc/conduit $ ``` What I find most concerning is that I'm getting an error about some missing field but it doesn't seem to be reading the file at all.
germtoo commented 2023-10-30 03:52:05 +00:00 (Migrated from gitlab.com)

Installed conduit natively to an x86_64 LLVM musl device and hit a similar error that does little to inform one of the issue.config.toml This config is located in /etc/conduit/conduit.toml and the contents of CONDUIT_CONFIG=$"{CONDUIT_CONFIG:=/etc/conduit/conduit.toml}" The error mentions a missing field called server_name that is in my config as "server_name = "mipseb.com""

Installed conduit natively to an x86_64 LLVM musl device and hit a similar error that does little to inform one of the issue.[config.toml](/uploads/e5d49c2c84f8c1ea014f93f3a334a513/config.toml) This config is located in /etc/conduit/conduit.toml and the contents of CONDUIT_CONFIG=$"{CONDUIT_CONFIG:=/etc/conduit/conduit.toml}" The error mentions a missing field called server_name that is in my config as "server_name = "mipseb.com""
Richard-Rogalski commented 2023-10-30 04:39:17 +00:00 (Migrated from gitlab.com)

welp, source of the issue found.

I was walking through zen and mips here through setting up conduit, and realized I forgot a crucial step: setting the .well-known/matrix/server (my fault guys, sorry!!)

However I didn't figure that out until now as the error message was completely misleading. The message indicates that either A), you have a typo or something wrong with your toml, or B), conduit can't find the toml (as zen suggested) as it seems to also be the error for when it can't find the config.

I don't think zen tested with git master, so I don't know if there is a sane error message for "we can't find/don't have perms to read the config" yet, but that would be nice, but also a message here explaining that 'server name' is indeed NOT missing, it just does not match what conduit is expecting. (if that's the issue, I don't really understand why that error was popping up tbh, just that now it's fixed)

welp, source of the issue found. I was walking through zen and mips here through setting up conduit, and realized I forgot a crucial step: setting the .well-known/matrix/server (my fault guys, sorry!!) However I didn't figure that out until now as the error message was completely misleading. The message indicates that either A), you have a typo or something wrong with your toml, or B), conduit can't find the toml (as zen suggested) as it seems to also be the error for when it can't find the config. I don't think zen tested with git master, so I don't know if there is a sane error message for "we can't find/don't have perms to read the config" yet, but that would be nice, but also a message here explaining that 'server name' is indeed NOT missing, it just does not match what conduit is expecting. (if that's the issue, I don't really understand why that error was popping up tbh, just that now it's fixed)
Sign in to join this conversation.
No labels
Android
CS::needs customer feedback
CS::needs follow up
CS::needs on prem installation
CS::waiting
Chrome
Design:: Ready
Design:: in progress
Design::UX
E2EE
Edge
Firefox
GDPR
Iteration 13 IM
Linux
MacOS
Need::Discussion
Need::Steps to reproduce
Need::Upstream fix
Needs:: Planning
Needs::Dev-Team
Needs::More information
Needs::Priority
Needs::Product
Needs::Refinement
Needs::Severity
Priority::1-Critical
Priority::2-Max
Priority::3-Impending
Priority::4-High
Priority::5-Medium
Priority::6-Low
Priority::7-None
Progress::Backlog
Progress::Review
Progress::Started
Progress::Testing
Progress::Triage
Progress::Waiting
Reporter::Sentry
Safari
Target::Community
Target::Customer
Target::Internal
Target::PoC
Target::Security
Team:Customer-Success
Team:Design
Team:Infrastructure
Team:Instant-Messaging
Team:Product
Team:Workflows
Type::Bug
Type::Design
Type::Documentation
Type::Feature
Type::Improvement
Type::Support
Type::Tests
Windows
blocked
blocked-by-spec
cla-signed
conduit
contribution::advanced
contribution::easy
contribution::help needed
from::review
iOS
p::ti-tenant
performance
product::triage
proposal
refactor
release-blocker
s: dart_openapi_codegen
s::Famedly-Patient
s::Org-Directory
s::Passport-Generator
s::Requeuest
s:CRM
s:Famedly-App
s:Famedly-Web
s:Fhiroxide
s:Fhiroxide-cli
s:Fhiroxide-client
s:Fhirs
s:Hedwig
s:LISA
s:Matrix-Dart-SDK
s:Role-Manager
s:Synapse
s:User-Directory
s:WFS-Matrix
s:Workflow Engine
s:dtls
s:famedly-error
s:fcm-shared-isolate
s:matrix-api-lite
s:multiple-tab-detector
s:native-imaging
severity::1
severity::2
severity::3
severity::4
technical-debt
voip
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Matthias/conduit#392
No description provided.