[Bug]: Settings file overwritten with broken config on startup
Installation Method
Docker
The Problem
I have installed / tried to install stirlingpdf via Docker Stack using the following docker-compose config.
version: '3.3'
services:
stirling-pdf:
image: stirlingtools/stirling-pdf:latest
ports:
- '8777:8080'
volumes:
- /home/media/tools/stirlingpdf/trainingData:/usr/share/tessdata # Required for extra OCR languages
- /home/media/tools/stirlingpdf/extraConfigs:/configs
- /home/media/tools/stirlingpdf/customFiles:/customFiles/
- /home/media/tools/stirlingpdf/logs:/logs/
- /home/media/tools/stirlingpdf/pipeline:/pipeline/
environment:
- DOCKER_ENABLE_SECURITY=true
- LANGS=en_GB,de_DE
- SECURITY_LOGINMETHOD='all'
I have added the SECURITY_LOGINMETHOD env variable because I get the following error on startup.
16:02:52.661 [main] INFO s.s.SPDF.config.ConfigInitializer - Settings file updated based on template changes.
16:02:52.663 [main] INFO s.software.SPDF.SPDFApplication - Settings file: ./configs/settings.yml
16:02:52.964 [main] ERROR o.s.boot.SpringApplication - Application run failed
org.yaml.snakeyaml.parser.ParserException: while parsing a block mapping
in 'reader', line 14, column 1:
security:
^
expected <block end>, but found '<block mapping start>'
in 'reader', line 19, column 3:
loginMethod: all # Accepts value ...
This error is not solved when editing the config to 'all' instead of all as the settings.yml file is overwritten on startup. I have also edited the settings.yml file to the following and it still changes back to default on startup.
security:
enableLogin: true
csrfDisabled: false
loginAttemptCount: 5
loginResetTimeMinutes: 1440
loginMethod: 'all' # Accepts values like 'all' and 'normal'(only Login with Username/Password), 'oauth2'(only Login with OAuth2) or 'saml2'(only Login with SAML2)
initialLogin:
username: 'admin' # initial username for the first login
password: 'changeme' # initial password for the first login
oauth2:
[...]
Version of Stirling-PDF
Latest docker image as of 6. Feb.. Tag 0.40.2
Last Working Version of Stirling-PDF
No response
Page Where the Problem Occurred
No response
Docker Configuration
version: '3.3'
services:
stirling-pdf:
image: stirlingtools/stirling-pdf:latest
ports:
- '8777:8080'
volumes:
- /home/media/tools/stirlingpdf/trainingData:/usr/share/tessdata # Required for extra OCR languages
- /home/media/tools/stirlingpdf/extraConfigs:/configs
- /home/media/tools/stirlingpdf/customFiles:/customFiles/
- /home/media/tools/stirlingpdf/logs:/logs/
- /home/media/tools/stirlingpdf/pipeline:/pipeline/
environment:
- DOCKER_ENABLE_SECURITY=true
- LANGS=en_GB,de_DE
- SECURITY_LOGINMETHOD='all'
Relevant Log Output
16:02:52.661 [main] INFO s.s.SPDF.config.ConfigInitializer - Settings file updated based on template changes.
16:02:52.663 [main] INFO s.software.SPDF.SPDFApplication - Settings file: ./configs/settings.yml
16:02:52.964 [main] ERROR o.s.boot.SpringApplication - Application run failed
org.yaml.snakeyaml.parser.ParserException: while parsing a block mapping
in 'reader', line 14, column 1:
security:
^
expected <block end>, but found '<block mapping start>'
in 'reader', line 19, column 3:
loginMethod: all # Accepts value ...
Additional Information
No response
Browsers Affected
No response
No Duplicate of the Issue
- [x] I have verified that there are no existing issues raised related to my problem.
Hello @sgart-git! I'm here to help with any bugs, questions, or contributions. If you need assistance, feel free to ask!
There are two similar closed issues that might be relevant to your problem:
-
Different reading and writing procedure for settings.yml - This issue was resolved by a pull request that changed the method for writing and reading the
settings.ymlfile. It was closed on June 15, 2024. -
Disable config file updating for now (causing issues) - This issue was closed without comments or references, so it might not provide a direct solution.
The first issue suggests that there was a change in how the settings.yml file is handled, which might be related to the problem you're experiencing with the file being overwritten on startup. You might want to check if your version includes these changes or if there are any updates available that address this issue.
To continue talking to Dosu, mention @dosu.
Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other
Looks like you might have changed the tabbing or some special characters, I recommend deleting the settings file and having it generate a new one for you
It is working no after deleting all file completely for the fourth time and setting DOCKER_ENABLE_SECURITY to false. I was now able to edit the settings file without it getting overwritten and the startup was successful. I'm kinda confused as to why it didn't work before. Thanks for making me try again