Cozy-stack installs but fails to read config


#1

The Error I get

ERRO[0000] Failed to read cozy-stack configurations from /etc/cozy/cozy.yml nspace=config
ERRO[0000] Error: While parsing config: yaml: found character that cannot start any token

not sure if this means there is a bad character in my admin password or something?


#2

Hello @caddy,

Looks like your /etc/cozy/cozy.yml file isn’t valid YAML. Maybe you can try to install the Debian package yamllint and use yamllint /etc/cozy/cozy.yml to find the syntax error.


#3

Hello @caddy,

I remember me one of my topic on the french side of the board (Erreur lors de la lecture du fichier de configuration), do you have the @ in your password ? If yes this is the problem. I make the same mistake on my first installation

Like @aeris tell me, there is a warning message in the documentation young padawan:

Pick an administrator password
(This password is used by shell scripts, so currently avoid to use one with simple or 
double quotes or others shell meaningfull symbols. We advice you to choose one 
with only alphanumeric digits to avoid troubles.)

#4

We shouldn’t probably expect people read the documentation, and add a test in our scripts to check for unauthorized characters in the password.


#5

That is exactly what i told to @aeris but it’s no as simple as it seems in the bash script to run regex (if i good understand)


#6
#!/bin/bash
forbidden="@;$"
expr=$(echo $forbidden | sed 's/\(.\)/\\\0/g')
read -rp "Password: " pass
clean=$(echo "$pass" | sed 's/['$expr']//g')
if [ "$clean" != "$pass" ]; then
  echo "Your password should'nt contain any of $forbidden"
fi

#7

@Clochix … maybe it’s not a priority on the roadmap. until this issue will be fixed, i will try to watch for topics about this bug and give the answer.

But maybe it didn’t resolve the @caddy issue ^^ (waiting for his answer)


#8

It’s more complicated in practice to handle the failed case… cozy-stack.config
And I’m not able to list every character which lead to a failure… Can fail in shell ($;&…), in yaml (&:_), in curl (@:/…), in couchdb (don’t know which ones…) and all of those with string protection ("'…). Better to advice to use only [a-zA-Z0-9-_]+.


#9

Yes my admin password does have a @ symbol in it. I saw the warning but as the warning did not have the specific illegal characters I was not sure which characters to avoid. I would prefer to have a secure password that breaks the config then have a weaker password.

that being said. how can I change the admin password after the initial config is done.


#10

so as a confirmation when I reset my VM and reinstalled from scratch with a different admin password that was just alpha numeric everything worked just fine.


#11