Problème accès couchdb - Failed to connect to localhost port 8080


#1

Bonjour,

de retour pour tenter d’installer une nouvelle instance de cozy, je me retrouve face à un problème que je n’arrive pas à résoudre.

Après l’installation de cozy-stack je fais curl http://localhost:8080/version mais j’ai l’erreur suivante :
curl: (7) Failed to connect to localhost port 8080: Connection refused

J’ai vérifié la conf dans le cozy.yml et le cozy.yml.local et tout à l’air normal.

J’ai regardé dans les logs syslog :

Mar 21 22:41:39 vps248101 systemd[1]: cozy-stack.service: Main process exited, code=exited, status=1/FAILURE
Mar 21 22:41:39 vps248101 systemd[1]: cozy-stack.service: Unit entered failed state.
Mar 21 22:41:39 vps248101 systemd[1]: cozy-stack.service: Failed with result ‘exit-code’.
Mar 21 22:41:39 vps248101 systemd[1]: cozy-stack.service: Service hold-off time over, scheduling restart.
Mar 21 22:41:39 vps248101 systemd[1]: Stopped Cozy service.
Mar 21 22:41:39 vps248101 systemd[1]: Started Cozy service.
Mar 21 22:41:39 vps248101 cozy[16593]: time=“2019-03-21T22:41:39+01:00” level=warning msg=“Could not reach Couchdb 2.0 database: == - http://cozy:monpassword@localhost:5984/\n Threshold: 0s\n Max: 2.132139ms\n Min: 2.132139ms\n Median: 2.132139ms\n Mean: 2.132139ms\n All: [{2.132139ms response status 401 Unauthorized}]\n Assessment: down\n, retrying in 1s”
Mar 21 22:41:40 vps248101 cozy[16593]: time=“2019-03-21T22:41:40+01:00” level=warning msg=“Could not reach Couchdb 2.0 database: == - http://cozy:monpassword@localhost:5984/\n Threshold: 0s\n Max: 7.510577ms\n Min: 7.510577ms\n Median: 7.510577ms\n Mean: 7.510577ms\n All: [{7.510577ms response status 401 Unauthorized}]\n Assessment: down\n, retrying in 1s”
Mar 21 22:41:41 vps248101 cozy[16593]: time=“2019-03-21T22:41:41+01:00” level=warning msg=“Could not reach Couchdb 2.0 database: == - http://cozy:monpassword@localhost:5984/\n Threshold: 0s\n Max: 1.099299ms\n Min: 1.099299ms\n Median: 1.099299ms\n Mean: 1.099299ms\n All: [{1.099299ms response status 401 Unauthorized}]\n Assessment: down\n, retrying in 1s”
Mar 21 22:41:42 vps248101 cozy[16593]: time=“2019-03-21T22:41:42+01:00” level=warning msg=“Could not reach Couchdb 2.0 database: == - http://cozy:monpassword@localhost:5984/\n Threshold: 0s\n Max: 1.829625ms\n Min: 1.829625ms\n Median: 1.829625ms\n Mean: 1.829625ms\n All: [{1.829625ms response status 401 Unauthorized}]\n Assessment: down\n, retrying in 1s”
Mar 21 22:41:43 vps248101 cozy[16593]: time=“2019-03-21T22:41:43+01:00” level=warning msg=“Could not reach Couchdb 2.0 database: == - http://cozy:monpassword@localhost:5984/\n Threshold: 0s\n Max: 1.207018ms\n Min: 1.207018ms\n Median: 1.207018ms\n Mean: 1.207018ms\n All: [{1.207018ms response status 401 Unauthorized}]\n Assessment: down\n, retrying in 1s”
Mar 21 22:41:44 vps248101 cozy[16593]: time=“2019-03-21T22:41:44+01:00” level=warning msg=“Could not reach Couchdb 2.0 database: == - http://cozy:monpassword@localhost:5984/\n Threshold: 0s\n Max: 2.175821ms\n Min: 2.175821ms\n Median: 2.175821ms\n Mean: 2.175821ms\n All: [{2.175821ms response status 401 Unauthorized}]\n Assessment: down\n, retrying in 1s”
Mar 21 22:41:45 vps248101 cozy[16593]: time=“2019-03-21T22:41:45+01:00” level=warning msg=“Could not reach Couchdb 2.0 database: == - http://cozy:monpassword@localhost:5984/\n Threshold: 0s\n Max: 1.07036ms\n Min: 1.07036ms\n Median: 1.07036ms\n Mean: 1.07036ms\n All: [{1.07036ms response status 401 Unauthorized}]\n Assessment: down\n, retrying in 1s”
Mar 21 22:41:46 vps248101 cozy-stack[16593]: Error: Could not reach Couchdb 2.0 database: == - http://cozy:monpassword@localhost:5984/
Mar 21 22:41:46 vps248101 cozy-stack[16593]: Threshold: 0s
Mar 21 22:41:46 vps248101 cozy-stack[16593]: Max: 1.477881ms
Mar 21 22:41:46 vps248101 cozy-stack[16593]: Min: 1.477881ms
Mar 21 22:41:46 vps248101 cozy-stack[16593]: Median: 1.477881ms
Mar 21 22:41:46 vps248101 cozy-stack[16593]: Mean: 1.477881ms
Mar 21 22:41:46 vps248101 cozy-stack[16593]: All: [{1.477881ms response status 401 Unauthorized}]
Mar 21 22:41:46 vps248101 cozy-stack[16593]: Assessment: down
Mar 21 22:41:46 vps248101 systemd[1]: cozy-stack.service: Main process exited, code=exited, status=1/FAILURE
Mar 21 22:41:46 vps248101 systemd[1]: cozy-stack.service: Unit entered failed state.
Mar 21 22:41:46 vps248101 systemd[1]: cozy-stack.service: Failed with result ‘exit-code’.
Mar 21 22:41:46 vps248101 systemd[1]: cozy-stack.service: Service hold-off time over, scheduling restart.
Mar 21 22:41:46 vps248101 systemd[1]: Stopped Cozy service.
Mar 21 22:41:46 vps248101 systemd[1]: Started Cozy service.

Manifestement il y a un problème de droit d’accès à couchedb. Pourtant les mots de passes sont bons. J’ai tenté sur deux serveurs différents avec une installation debian fraiche.

Quelqu’un a-il rencontré ce problème dernièrement?

Merci d’avance pour votre aide.


#2

Ok trouvé,

le problème vient du user qui est positionné à cozy au lieu d’admin dans le fichier de conf.


#3

Un autre petit soucis, les données de connexion de couchdb sont présentes dans le fichier cozy.yml.local et non dans le fichier cozy.yml. Cela pose un soucis lors de la création de l’instance cozy dans le script python :

/usr/lib/python3/dist-packages/cozy/coclyco/init.py à la ligne 21 car ce bout de code plante :

config = os.environ.get(“COZY_CONFIG”, “/etc/cozy/cozy.yml”)
with open(config, “r”) as file:
config = yaml.load(file)
self.__url = config[“couchdb”][“url”]

J’ai donc copié l’intégralité de cozy.yml.local dans cozy.yml sans remplacer l’existant et l’installation de l’instance cozy via cozy-coclyco a bien fonctionné.

Il n’y a pas un soucis de génération de fichiers de conf lors de l’installation de cozy-stack?

Bonne soirée.


#4

Salut @glelostec !

Effectivement, j’ai raté cette config pour Coclyco. Je vais corriger ça rapidement !


#5

Nouvelle version livrée à l’instant, ça devrait mieux fonctionner du coup