Problem with GotoSocial yaml

What type of hardware are you using: Old laptop or computer
What YunoHost version are you running: 12.0.17
What app is this about: GotoSocial

Describe your issue

Hello,

This morning I noticed someone trying to sign up to my instrance, which has always been closed before. I went into settings and say registrations were open, so I changed the setting here to prevent new sign ups and then saved (without changing anything else).

The instance then stopped working and the logs state

journalctl

Jun 25 21:16:08 systemd[1]: gotosocial.service: Failed with result ā€˜exit-code’.
Jun 25 21:16:08 systemd[1]: Failed to start gotosocial.service - GoToSocial Server.

and /var/log/gotosocial/gotosocial.log

2025/06/25 21:16:08 error executing command: error reloading config: While parsing config: yaml: line 33: did not find expected key

I’ve tried turning registrations back to true, restarted, then back to false and restarted but no joy.

I did check the yaml file and couldn’t see anything at line 33 that looked off but I’m not a code person… Also the yaml states at the top that it really should be done in the user interafce. I’ve rebooted the server and repeated the steps laid out but I’m going round in circles and don’t want to cause further damage!

Any help very much appreciated!

Thanks in advance.

Share relevant logs or error messages

journalctl

Jun 25 21:13:13 systemd[1]: gotosocial.service: Scheduled restart job, restart counter is at 3.
Jun 25 21:13:13 systemd[1]: Stopped gotosocial.service - GoToSocial Server.
Jun 25 21:13:13 systemd[1]: Starting gotosocial.service - GoToSocial Server...
Jun 25 21:13:13 systemd[1]: Started gotosocial.service - GoToSocial Server.
Jun 25 21:13:13 systemd[1]: gotosocial.service: Main process exited, code=exited, status=1/FAILURE
Jun 25 21:13:13 systemd[1]: gotosocial.service: Failed with result 'exit-code'.
Jun 25 21:13:13 systemd[1]: gotosocial.service: Scheduled restart job, restart counter is at 4.
Jun 25 21:13:13 systemd[1]: Stopped gotosocial.service - GoToSocial Server.
Jun 25 21:13:13 systemd[1]: Starting gotosocial.service - GoToSocial Server...
Jun 25 21:13:13 systemd[1]: Started gotosocial.service - GoToSocial Server.
Jun 25 21:13:14 systemd[1]: gotosocial.service: Main process exited, code=exited, status=1/FAILURE
Jun 25 21:13:14 systemd[1]: gotosocial.service: Failed with result 'exit-code'.
Jun 25 21:13:14 systemd[1]: gotosocial.service: Scheduled restart job, restart counter is at 5.
Jun 25 21:13:14 systemd[1]: Stopped gotosocial.service - GoToSocial Server.
Jun 25 21:13:14 systemd[1]: gotosocial.service: Start request repeated too quickly.
Jun 25 21:13:14 systemd[1]: gotosocial.service: Failed with result 'exit-code'.
Jun 25 21:13:14 systemd[1]: Failed to start gotosocial.service - GoToSocial Server.
Jun 25 21:16:05 systemd[1]: Starting gotosocial.service - GoToSocial Server...
Jun 25 21:16:05 systemd[1]: Started gotosocial.service - GoToSocial Server.
Jun 25 21:16:06 systemd[1]: gotosocial.service: Main process exited, code=exited, status=1/FAILURE
Jun 25 21:16:06 systemd[1]: gotosocial.service: Failed with result 'exit-code'.
Jun 25 21:16:06 systemd[1]: gotosocial.service: Scheduled restart job, restart counter is at 1.
Jun 25 21:16:06 systemd[1]: Stopped gotosocial.service - GoToSocial Server.
Jun 25 21:16:06 systemd[1]: Starting gotosocial.service - GoToSocial Server...
Jun 25 21:16:06 systemd[1]: Started gotosocial.service - GoToSocial Server.
Jun 25 21:16:06 systemd[1]: gotosocial.service: Main process exited, code=exited, status=1/FAILURE
Jun 25 21:16:06 systemd[1]: gotosocial.service: Failed with result 'exit-code'.
Jun 25 21:16:06 systemd[1]: gotosocial.service: Scheduled restart job, restart counter is at 2.
Jun 25 21:16:06 systemd[1]: Stopped gotosocial.service - GoToSocial Server.
Jun 25 21:16:06 systemd[1]: Starting gotosocial.service - GoToSocial Server...
Jun 25 21:16:06 systemd[1]: Started gotosocial.service - GoToSocial Server.
Jun 25 21:16:07 systemd[1]: gotosocial.service: Main process exited, code=exited, status=1/FAILURE
Jun 25 21:16:07 systemd[1]: gotosocial.service: Failed with result 'exit-code'.
Jun 25 21:16:07 systemd[1]: gotosocial.service: Scheduled restart job, restart counter is at 3.
Jun 25 21:16:07 systemd[1]: Stopped gotosocial.service - GoToSocial Server.
Jun 25 21:16:07 systemd[1]: Starting gotosocial.service - GoToSocial Server...
Jun 25 21:16:07 systemd[1]: Started gotosocial.service - GoToSocial Server.
Jun 25 21:16:07 systemd[1]: gotosocial.service: Main process exited, code=exited, status=1/FAILURE
Jun 25 21:16:07 systemd[1]: gotosocial.service: Failed with result 'exit-code'.
Jun 25 21:16:07 systemd[1]: gotosocial.service: Scheduled restart job, restart counter is at 4.
Jun 25 21:16:07 systemd[1]: Stopped gotosocial.service - GoToSocial Server.
Jun 25 21:16:07 systemd[1]: Starting gotosocial.service - GoToSocial Server...
Jun 25 21:16:07 systemd[1]: Started gotosocial.service - GoToSocial Server.
Jun 25 21:16:08 systemd[1]: gotosocial.service: Main process exited, code=exited, status=1/FAILURE
Jun 25 21:16:08 systemd[1]: gotosocial.service: Failed with result 'exit-code'.
Jun 25 21:16:08 systemd[1]: gotosocial.service: Scheduled restart job, restart counter is at 5.
Jun 25 21:16:08 systemd[1]: Stopped gotosocial.service - GoToSocial Server.
Jun 25 21:16:08 systemd[1]: gotosocial.service: Start request repeated too quickly.
Jun 25 21:16:08 systemd[1]: gotosocial.service: Failed with result 'exit-code'.
Jun 25 21:16:08 systemd[1]: Failed to start gotosocial.service - GoToSocial Server.

/var/log/gotosocial/gotosocial.log

2025/06/25 21:05:43 error executing command: error reloading config: While parsing config: yaml: line 33: did not find expected key
2025/06/25 21:05:43 error executing command: error reloading config: While parsing config: yaml: line 33: did not find expected key
2025/06/25 21:05:44 error executing command: error reloading config: While parsing config: yaml: line 33: did not find expected key
2025/06/25 21:05:44 error executing command: error reloading config: While parsing config: yaml: line 33: did not find expected key
2025/06/25 21:13:11 error executing command: error reloading config: While parsing config: yaml: line 33: did not find expected key
2025/06/25 21:13:12 error executing command: error reloading config: While parsing config: yaml: line 33: did not find expected key
2025/06/25 21:13:13 error executing command: error reloading config: While parsing config: yaml: line 33: did not find expected key
2025/06/25 21:13:13 error executing command: error reloading config: While parsing config: yaml: line 33: did not find expected key
2025/06/25 21:13:14 error executing command: error reloading config: While parsing config: yaml: line 33: did not find expected key
2025/06/25 21:16:06 error executing command: error reloading config: While parsing config: yaml: line 33: did not find expected key
2025/06/25 21:16:06 error executing command: error reloading config: While parsing config: yaml: line 33: did not find expected key
2025/06/25 21:16:07 error executing command: error reloading config: While parsing config: yaml: line 33: did not find expected key
2025/06/25 21:16:07 error executing command: error reloading config: While parsing config: yaml: line 33: did not find expected key
2025/06/25 21:16:08 error executing command: error reloading config: While parsing config: yaml: line 33: did not find expected key
1 Like

Hello @mxtthxw
What’s the output of sed -n '33p' /var/www/gotosocial/config.yaml ?

Here is the default config file gotosocial_ynh/conf/config.yaml at master Ā· YunoHost-Apps/gotosocial_ynh Ā· GitHub

Can you share the first 40 lines of the file? There should be nothing sensitive unless it has been modified, so just replace it with xxxx.

Hello, thanks for getting back… Here’s what the yaml says.

# ⚠ IMPORTANT WARNING: do NOT edit this config file by hand, 
# else your modifications will be ERASED at each update of the GTS package! 
# Instead, use the config panel in your web admin interface: 
# Applications āž” GoToSocial āž” Config panel āž” do your config edit āž” Save 
# Most of the relevant settings are available in the config panel, if you're 
# missing one, open an issue: https://github.com/YunoHost-Apps/gotosocial_ynh/issues 

--- 

# GoToSocial 
# Copyright (C) GoToSocial Authors admin@gotosocial.org 
# SPDX-License-Identifier: AGPL-3.0-or-later 
# 
# This program is free software: you can redistribute it and/or modify 
# it under the terms of the GNU Affero General Public License as published by 
# the Free Software Foundation, either version 3 of the License, or 
# (at your option) any later version. 
# 
# This program is distributed in the hope that it will be useful, 
# but WITHOUT ANY WARRANTY; without even the implied warranty of 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
# GNU Affero General Public License for more details. 
# 
# You should have received a copy of the GNU Affero General Public License 
# along with this program.  If not, see <http://www.gnu.org/licenses/>. 

########################### 
##### GENERAL CONFIG ###### 
########################### 

# String. Log level to use throughout the application. Must be lower-case. 
# Options: ["trace","debug","info","warn","error","fatal"] 
# Default: "info" 
log-level: "info" 

# Bool. Log database queries when log-level is set to debug or trace. 
# This setting produces verbose logs, so it's better to only enable it 
# when you're trying to track an issue down. 
# Options: [true, false] 
# Default: false 
log-db-queries: false 

# Bool. Include the client IP in the emitted log lines 
# Options: [true, false] 
# Default: true 
log-client-ip: true 

# String. Format to use for the timestamp in log lines. 
# If set to the empty string, the timestamp will be 
# ommitted from the logs entirely. 
# 
# The format must be compatible with Go's time.Layout, as 
# documented on https://pkg.go.dev/time#pkg-constants. 
# 
# Examples: ["2006-01-02T15:04:05.000Z07:00", ""] 
# Default: "02/01/2006 15:04:05.000" 
log-timestamp-format: "02/01/2006 15:04:05.000" 

# String. Application name to use internally. 
# Examples: ["My Application","gotosocial"] 
# Default: "gotosocial" 
application-name: "gotosocial" 

# String. The user that will be shown instead of the landing page. if no user is set, the landing page will be shown. 
# Examples: "admin" 
# Default: "" 
landing-page-user: "" 

# String. Hostname that this server will be reachable at. Defaults to localhost for local testing, 
# but you should *definitely* change this when running for real, or your server won't work at all. 
# DO NOT change this after your server has already run once, or you will break things! 
# Examples: ["gts.example.org","some.server.com"] 
# Default: "localhost" 
host: "gts.example.org"

You didn’t mention the version of GoToSocial you have

Sorry it’s 0.19.1~ynh1

@mxtthxw

In the config.yaml, check the instance-languages line looking for a missing opening bracket…
It should follow this pattern instance-languages: ["nl", "en-gb", "fr"] or `instance-languages: [ ]
etc.
In the web admin config panel of gotosocial, the opening bracket before the list of languages must be left. If removed, the config file is no longer valid. And instance-languages indeed corresponds to the interpreted line 33…

Yay!!!

Now here’s the interesting thing… When I do this in the user interface, each time after saving it removes the first " in the ā€œen-gbā€ no idea why but it repeatedly does it. However, doing this in the yaml has resolved the issue!

Super massive thanks!!!

So it’s a bug in the webadmin config panel

1 Like

Yes. Here’s the default value :
image
And there seem to be several bugs. When I tried to change the language settings in the config panel, it first reported an error with the SMTP ā€˜from’ address. When smtp from address seems ok, it says it cannot write changes to a settings.yml file that indeed does not exist in /var/www/ (a confusion between settings.yml and config.yaml in the script ?).

2025-06-26 12:26:03,118: DEBUG - + for short_setting in "${!old[@]}"
2025-06-26 12:26:03,118: DEBUG - + ynh_app_config_apply_one instance_languages
2025-06-26 12:26:03,118: DEBUG - + _ynh_app_config_apply_one instance_languages
2025-06-26 12:26:03,118: DEBUG - + local short_setting=instance_languages
2025-06-26 12:26:03,118: DEBUG - + local setter=set__instance_languages
2025-06-26 12:26:03,118: DEBUG - + local bind=instance-languages:/var/www/gotosocial/config.yaml
2025-06-26 12:26:03,118: DEBUG - + local type=string
2025-06-26 12:26:03,118: DEBUG - + '[' true == true ']'
2025-06-26 12:26:03,118: DEBUG - + grep -q '^function$'
2025-06-26 12:26:03,118: DEBUG - + type -t set__instance_languages
2025-06-26 12:26:03,118: DEBUG - + set__instance_languages
2025-06-26 12:26:03,118: DEBUG - + ynh_app_setting_set --key=instance_languages '--value="nl", "en-gb", "fr"'
2025-06-26 12:26:03,230: DEBUG - + ynh_write_var_in_file --file=/var/www/gotosocial/settings.yml --key=instance-languages '--value=["nl", "en-gb", "fr"]'
2025-06-26 12:26:03,348: DEBUG - + after=
2025-06-26 12:26:03,348: DEBUG - + [[ -f /var/www/gotosocial/settings.yml ]]
2025-06-26 12:26:03,348: DEBUG - + ynh_die 'File /var/www/gotosocial/settings.yml does not exists'
2025-06-26 12:26:03,415: WARNING - File /var/www/gotosocial/settings.yml does not exists