Closed wannesrams closed 4 years ago
Hi @wannesrams
Relevant message seems to be: "Error configuring Authenticator simpleFileAuthenticator"
Your configuration file for simpleFileAuthenticator looks to have an indentation problem:
users:
- userid: hidden
password: hidden
roles: [users]
- userid: hidden
password: hidden
roles: [users]
Please check if this is the problem.
you can use an online yaml validator as https://codebeautify.org/yaml-validator to check your conf file
the correct users.yml file is
users:
- userid: hidden
password: hidden
roles: [users]
- userid: hidden
password: hidden
roles: [users]
## configuration file for requestPredicatesAuthorizer
permissions:
# OPTIONS is always allowed
- role: $unauthenticated
predicate: path-prefix[path="/echo"] and method[value="GET"]
- role: admin
predicate: path-prefix[path="/"]
# Users with role 'users' can GET any collection or document resource (excluding dbs and _logic )
- role: users
predicate: regex[pattern="/.*/.*", value="%R", full-match=true] and method[value="GET"] and not path-prefix[path="/_logic"]
# Users with role 'users' can request URI /_logic/csv
- role: users
predicate: path["/_logic/csv"]
# Users with role 'users' can do anything on the collection /publicdb/{username}
- role: users
predicate: path-template[value="/publicdb/{username}"] and equals[%u, "${username}"]
# Users with role 'users' can do anything on documents of the collection /publicdb/{username}
- role: users
predicate: path-template[value="/publicdb/{username}/{doc}"] and equals[%u, "${username}"]
Thanks for the quick answer. Corrected the files same error
## configuration file for simpleFileAuthenticator
users:
- userid: hidden
password: hidden
roles: [users]
- userid: hidden
password: hidden
roles: [users]``
## configuration file for requestPredicatesAuthorizer
permissions:
# OPTIONS is always allowed
- role: $unauthenticated
predicate: path-prefix[path="/echo"] and method[value="GET"]
- role: admin
predicate: path-prefix[path="/"]
#Users with role 'users' can GET any collection or document resource (excluding dbs and _logic )
- role: users
predicate: regex[pattern="/.*/.*", value="%R", full-match=true] and method[value="GET"] and not path-prefix[path="/_logic"]
#Users with role 'users' can request URI /_logic/csv
- role: users
predicate: path["/_logic/csv"]
#Users with role 'users' can do anything on the collection /publicdb/{username}
- role: users
predicate: path-template[value="/publicdb/{username}"] and equals[%u, "${username}"]
#Users with role 'users' can do anything on documents of the collection /publicdb/{username}
- role: users
predicate: path-template[value="/publicdb/{username}/{doc}"] and equals[%u, "${username}"]``
Downloaded the latest release with all default settings and config files, same error
we noticed a small misconfiguration in restheart-security.yml file and fixed it (going to publish a new release soon)
the issue was in the following configuration options:
conf-file: ../etc/acl.yml and conf-file: ../etc/users.yml
the correct values are:
conf-file: ./etc/acl.yml and conf-file: ./etc/users.yml (only one dot .)
(the path are relative to the directory where the restheart-security.jar file is)
However your issue you reported seems to be related to an error with yml formatting
see org.yaml.snakeyaml.error.YAMLException: java.nio.charset.MalformedInputException: Input length = 1
snakeyaml is the yml parser.....
The following stracktrace:
Caused by: java.nio.charset.MalformedInputException: Input length = 1
at java.base/java.nio.charset.CoderResult.throwException(CoderResult.java:274)
at java.base/sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:339)
at java.base/sun.nio.cs.StreamDecoder.read(StreamDecoder.java:178)
at java.base/java.io.InputStreamReader.read(InputStreamReader.java:185)
at org.yaml.snakeyaml.reader.UnicodeReader.read(UnicodeReader.java:125)
Says there's a failure in the UnicodeReader
class of snakeyaml parser. Often it indicates that the YAML file contains some non UTF-8 character. Maybe the file has been saved in a different charset, like Windows-1252 ? Could you please try to be sure that the YAML file is saved as UTF-8 and it doesn't contain any non-visible character?
version 1.3.2 with conf file fix is out https://github.com/SoftInstigate/restheart-security/releases/tag/1.3.2
closing for now, feel free to reopen in case your problem persists.
Thanks @ujibang I already found and fixed the 2 dot issue, but good to see it fixed in the release. Issue found as @mkjsix indicated. a € symbol should not be in the file, it was part of a password
I am unable to start Restheart Security. Anyone knows what might be wrong? I am in the dark. I get the following error
The start command is
the relevant block in my main config file is
And the users and acl files are configuration file for simpleFileAuthenticator
Using version 4.1.3 and I have no clue what is wrong.