Bonsoir à toutes et à tous,

je souhaiterais installer Firefox syncserver sur mon serveur ubuntu 18.
J'ai donc suivi les instructions présentées ici https://mozilla-services.readthedocs.io/en/latest/howtos/run-sync-1.5.html#howto-run-sync15
et tout a bien fonctionné jusqu'à la configuration d'apache.
Après avoir activé le nouvel hôte virtuel, j'obtiens une erreur en éxécutant la commande apachectl -t, et de toutes les manière lorsque je redémarre celui-ci.
Voici ce que j'obtiens:
pascal@ubuntu-server:/etc/apache2/sites-available$ systemctl status apache2.service
● apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           └─apache2-systemd.conf
   Active: failed (Result: exit-code) since Fri 2020-05-01 21:56:05 CEST; 17s ago
  Process: 5790 ExecStop=/usr/sbin/apachectl stop (code=exited, status=1/FAILURE)
  Process: 4430 ExecReload=/usr/sbin/apachectl graceful (code=exited, status=0/SUCCESS)
  Process: 5799 ExecStart=/usr/sbin/apachectl start (code=exited, status=1/FAILURE)
 Main PID: 3779 (code=exited, status=0/SUCCESS)

mai 01 21:56:05 ubuntu-server systemd[1]: Starting The Apache HTTP Server...
mai 01 21:56:05 ubuntu-server apachectl[5799]: AH00544: apache2: bad group name sync
mai 01 21:56:05 ubuntu-server apachectl[5799]: Action 'start' failed.
mai 01 21:56:05 ubuntu-server apachectl[5799]: The Apache error log may have more information.
mai 01 21:56:05 ubuntu-server systemd[1]: apache2.service: Control process exited, code=exited status=1
mai 01 21:56:05 ubuntu-server systemd[1]: apache2.service: Failed with result 'exit-code'.
mai 01 21:56:05 ubuntu-server systemd[1]: Failed to start The Apache HTTP Server.
Je n'ai rien trouvé sur l'erreur "AH00544: apache2: bad group name sync"
Pourriez-vous m'aider s'il vous plait ?
Merci par avance.

Pascal
la doc ne fonctionne pas, d'ailleurs il y a déjà une issue à ce sujet : https://github.com/mozilla-services/syncserver/issues/210

en attendant que ça revienne tu peux donner le retour de :
grep sync /etc/group
et aussi :
grep -rni Group /etc/apache2
Bonjour Krodelabestiole,
krodelabestiole a écritla doc ne fonctionne pas, d'ailleurs il y a déjà une issue à ce sujet : https://github.com/mozilla-services/syncserver/issues/210
Effectivement, la doc ne fonctionne plus, mais elle a été archivé par "wayback machine":
https://web.archive.org/web/20200414180947/https://mozilla-services.readthedocs.io/en/latest/howtos/run-sync-1.5.html
krodelabestiole a écrit en attendant que ça revienne tu peux donner le retour de :
grep sync /etc/group
Cette commande ne me donne aucun retour,
Mais par contre celle-ci
krodelabestiole a écrit et aussi :
grep -rni Group /etc/apache2
me donne :
grep -rni Group /etc/apache2
/etc/apache2/mods-available/authz_groupfile.load:2:LoadModule authz_groupfile_module /usr/lib/apache2/modules/mod_authz_groupfile.so
/etc/apache2/mods-available/wsgi.conf:92:    #serialize multiple daemon processes in a process group accepting requests
/etc/apache2/mods-available/wsgi.conf:107:    #name of the process group and the application group into which the script
/etc/apache2/mods-available/wsgi.conf:110:        #WSGIImportScript process-group=name application-group=name
/etc/apache2/apache2.conf:116:Group ${APACHE_RUN_GROUP}
/etc/apache2/envvars:17:export APACHE_RUN_GROUP=www-data
grep: /etc/apache2/ssl/MyOwnCloud.key: Permission non accordée
/etc/apache2/sites-available/syncserver.conf:8:  WSGIProcessGroup sync
/etc/apache2/sites-available/syncserver.conf:9:  WSGIDaemonProcess sync user=sync group=sync processes=2 threads=25 python-path=/opt/syncserver/local/lib/python2.7/site-packages/
Merci par avance pour ton aide précieuse !

Pascal
WSGIProcessGroup sync
WSGIDaemonProcess sync user=sync group=sync processes=2 threads=25 python-path=/path/to/syncserver/local/lib/python2.7/site-packages/
en gros apache essaie de faire exécuter un sous process par un user / group qui n'existe pas sur ton système.

apparemment la création de cet utilisateur n'est pas documentée... tu peux essayer de le créer comme ça :
sudo useradd sync --no-create-home
si il existe déjà, créé seulement le groupe :
sudo groupadd sync
et ajoute l'utilisateur sync au groupe sync :
sudo usermod -g sync sync
pour vérifier qu'il est bien dans le groupe sync :
groups sync
Bonsoir,
merci pour ta réponse, je vais essayer ce que tu m'indiques. Je comprends pas non plus à quoi cet utilisateur peu bien servir...
Bonjour,
avant d'avoir essayé tes commandes, j'ai regardé si sync existe sur ma machine (excusez moi, je commence à peine à me débrouiller avec Linux, ça commence à rentrer petit à petit 😉 ), j'ai fait ceci:
grep sync /etc/passwd
sync:x:4:65534:sync:/bin:/bin/sync
Je m'en doutais un peu, mais c'est un utilisateur système (UID < 1000). Concernant le GUID, j'ai regardé dans le fichier /etc/group et 65534 correspond à "nogroup".
Et effectivement le groupe sync n'existe pas non plus !
😉
krodelabestiole a écrit si il existe déjà, créé seulement le groupe :
sudo groupadd sync
et ajoute l'utilisateur sync au groupe sync :
sudo usermod -g sync sync
Re,
ta solution fonctionne, je te remercie.
A bientôt !
7 jours plus tard
Bonjour à toutes et tous,

Je suis désolé de réouvrir le sujet.
En effet, après avoir épluché un maximum de tuto autant en anglais qu'en français (une dizaine en tout), je n'arrive toujours pas à faire fonctionner syncserver vers l'extérieur.
En configurant tout en local, ça fonctionne. Je ne sais pas si le problème vient de le configuration de l'hôte virtuel d'apache, mais en tout cas j'ai du là aussi en essayer des dizaines.
Je précise également que cette machine héberge aussi un serveur owncloud, et que lui fonctionne très bien.
Je me suis dit que les deux hôtes entraient en conflit, donc j'ai désactivé temporairement l'hôte owncloud, mais ça n'a pas résolu mon problème.

En regardant les logs de synchronisation d'un Firefox sur une machine externe, j'ai trouvé des erreurs:
1589045191643	Services.Common.TokenServerClient	DEBUG	Beginning BID assertion exchange: https://xxx.xxx.xxx.xxx/token/1.0/sync/1.5
1589045191643	Services.Common.RESTRequest	DEBUG	GET request to https://xxx.xxx.xxx.xxx/token/1.0/sync/1.5
1589045191675	Services.Common.RESTRequest	DEBUG	GET https://xxx.xxx.xxx.xxx/token/1.0/sync/1.5 failed: 2153398258 - 
1589045191675	Sync.BrowserIDManager	ERROR	Non-authentication error in _fetchTokenForUser: TokenServerClientNetworkError({"error":{}})(resource://services-common/tokenserverclient.js:39:36) JS Stack trace: TokenServerClientNetworkError@tokenserverclient.js:62:16
Dans les logs apache, le fichier d'acces est vide, le fichier d'erreur contient:
Sun May 10 06:25:02.279733 2020] [ssl:warn] [pid 5985] AH01906: ubuntu-server.lan:443:0 server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)
[Sun May 10 06:25:02.279771 2020] [ssl:warn] [pid 5985] AH01909: ubuntu-server.lan:443:0 server certificate does NOT include an ID which matches the server name
Voici la configuration de l'hôte virtuel:
<IfModule mod_ssl.c>
<VirtualHost *:443>
  #ServerName example.com
  DocumentRoot /opt/syncserver

  SSLEngine on
  SSLCertificateFile /etc/apache2/ssl/syncserver.cer
  SSLCertificateKeyFile /etc/apache2/ssl/syncserver.key

  WSGIProcessGroup sync
  WSGIDaemonProcess sync user=sync group=sync processes=2 threads=25 python-path=/opt/syncserver/local/lib/python2.7/site-packages/
  WSGIPassAuthorization On
  WSGIScriptAlias / /opt/syncserver/syncserver.wsgi
  CustomLog /var/log/apache2/syncserver-access.log combined
  ErrorLog  /var/log/apache2/syncserver-error.log

<Directory /opt/syncserver>
  Require all granted
  Options -Indexes
</Directory>
</VirtualHost>
</IfModule>
Voici la configuration de syncserver:
[server:main]
use = egg:gunicorn
host = 0.0.0.0
port = 5000
workers = 1
timeout = 30

[app:main]
use = egg:syncserver

[syncserver]
# This must be edited to point to the public URL of your server,
# i.e. the URL as seen by Firefox.
#public_url = http://192.168.1.61:5000/
public_url = https://xxx.xxx.xxx.xxx/

# By default, syncserver will accept identity assertions issued by
# any BrowserID issuer.  The line below restricts it to accept assertions
# from just the production Firefox Account servers.  If you are hosting
# your own account server, put its public URL here instead.
identity_provider = https://accounts.firefox.com/

# This defines the database in which to store all server data.
#sqluri = sqlite:////tmp/syncserver.db
sqluri = pymysql://firefox:motdepasse@127.0.0.1/firefoxsync

# This is a secret key used for signing authentication tokens.
# It should be long and randomly-generated.
# The following command will give a suitable value on *nix systems:
#
#    head -c 20 /dev/urandom | sha1sum
#
# If not specified then the server will generate a temporary one at startup.
#secret = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

# Set this to "false" to disable new-user signups on the server.
# Only requests by existing accounts will be honoured.
#allow_new_users = false

# Set this to "true" to work around a mismatch between public_url and
# the application URL as seen by python, which can happen in certain reverse-
# proxy hosting setups.  It will overwrite the WSGI environ dict with the
# details from public_url.  This could have security implications if e.g.
# you tell the app that it's on HTTPS but it's really on HTTP, so it should
# only be used as a last resort and after careful checking of server config.
force_wsgi_environ = false
[tokenserver]
# Use a custom MySQL based syncstorage node hosted at http://localhost:8000

# node_url = http://localhost:8000
# sqluri = pymysql://sample_user:sample_password@127.0.0.1/syncstorage_rs

[endpoints]
# Replace syncserver endpoints with alternate server implementation, ie:
# MySQL based syncstorage-rs 1.5 server hosted at http://localhost:8000/1.5

# "{node}/1.5/{uid}"
# sync-1.5 = "http://localhost:8000/1.5/{uid}"
Je vous prie de bien vouloir être indulgent avec moi, mes connaissances dans les serveurs étant très générales (je suis ingénieur en électronique...), donc je pense que je loupe quelque chose dans l'histoire, notamment dans la configuration d'apache.

Je vous remercie par avance pour votre aide précieuse!
Bonjour,

Tu n'as pas de nom de domaine pour faire cela (pas de directive ServerName) ? Et un vrai certificat généré par Let'sEncrypt avec certbot ?
public_url = https://xxx.xxx.xxx.xxx/
À quoi correspondent les xxx ? Une adresse IP publique ?
bruno a écritBonjour,

Tu n'as pas de nom de domaine pour faire cela (pas de directive ServerName) ? Et un vrai certificat généré par Let'sEncrypt avec certbot ?
public_url = https://xxx.xxx.xxx.xxx/
À quoi correspondent les xxx ? Une adresse IP publique ?
Salut,
oui j'ai un nom de domaine, mais je ne l'ai pas encore redirigé vers le serveur, il est pour l'instant hébergé.
Concernant cerbot, j'ai commencé à me documenter hier rapidement, je n'ai pas encore décidé de ce côté là....
Les xxx correspondent effectivement à mon adresse publique.
Merci à toi
Si tu as un nom de domaine example.com tu as tout intérêt à utiliser sync.example.com, par exemple.
Il faudra régler les enregistrement DNS pour qu'il pointe vers l'IP de ton serveur, mettre la directive :
ServerName sync.example.com
dans ton hôte virtuel.

Et après avoir redémarrer apache, tester depuis une autre machine l'URL https://sync.example.com qui doit renvoyer « it works! ».
Si tu n'as pas de « vrai » certificat, il vaut mieux rester en HTTP pour tester. Je ne sais pas comment Firefox réagit avec un certificat auto-signé dans ce cas précis.
7 jours plus tard
Bonjour Bruno, bonjour à toutes et tous,

j'ai donc poursuivi la configuration de mon serveur, j'ai suivi tes conseils Bruno: j'ai créé deux sous domaines, l'un pour owncloud, l'autre pour syncserver.
Je pense que mes hôtes virtuels sont bien configurés maintenant, puisqu'en allant sur https://owncloud.mondomaine.com j'accède bien à la page de owncloud, et en allant sur https://syncserver.mondomaine.com j'obtiens bien le "it works"

Voici l'hôte virtuel, syncserver.mondomaine.com.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
  ServerName syncserver.mondomaine.com
  DocumentRoot /opt/syncserver

  SSLEngine on
  SSLCertificateFile /etc/apache2/ssl/syncserver.mondomaine.com.crt
  SSLCertificateKeyFile /etc/apache2/ssl/syncserver.mondomaine.com.key
  #SSLCertificateChainFile /etc/ssl/private/sync.adminforge.de_ecc/ca.cer


  WSGIProcessGroup sync
  WSGIDaemonProcess sync user=sync group=sync processes=2 threads=25 python-path=/opt/syncserver/local/lib/python2.7/site-packages/
  WSGIPassAuthorization On
  WSGIScriptAlias / /opt/syncserver/syncserver.wsgi
  CustomLog /var/log/apache2/syncserver.mondomaine.com-access.log combined
  ErrorLog  /var/log/apache2/syncserver.mondomaine.com-error.log

<Directory /opt/syncserver>
  Require all granted
  Options -Indexes
</Directory>
</VirtualHost>
</IfModule>
Mais syncserver ne fonctionne toujours pas !
Dans les logs de Firefox, j'ai toujours des erreurs:
1589713084315	Sync.LogManager	DEBUG	Flushing file log
1589713084339	Sync.LogManager	DEBUG	Log cleanup threshold time: 1588849084339
1589713084359	Sync.LogManager	DEBUG	Done deleting files.
1589713087278	Sync.RemoteTabs	INFO	Generating tab list with filter
1589713087278	Sync.RemoteTabs	INFO	Final tab list has 0 clients with 0 tabs.
1589713193297	FirefoxAccounts	INFO	Polling device commands.
1589713193297	Sync.Service	DEBUG	User-Agent: Firefox/76.0.1 (Linux x86_64) FxSync/1.78.0.20200507114007.desktop
1589713193298	Sync.Service	INFO	Starting sync at 2020-05-17 12:59:53 in browser session Eawa7ueh2QOn
1589713193298	Sync.Service	DEBUG	In sync: should login.
1589713193298	Sync.Service	INFO	User logged in successfully - verifying login.
1589713193300	FirefoxAccounts	TRACE	not checking freshness of profile as it remains recent
1589713193300	Sync.BrowserIDManager	DEBUG	unlockAndVerifyAuthState already has (or can fetch) sync keys
1589713193300	Sync.Status	DEBUG	Status.login: error.login.reason.network => success.status_ok
1589713193301	Sync.Status	DEBUG	Status.service: error.login.failed => error.login.failed
1589713193301	Sync.Service	DEBUG	Fetching unlocked auth state returned success.status_ok
1589713193302	FirefoxAccounts	TRACE	not checking freshness of profile as it remains recent
1589713193312	Services.Common.RESTRequest	DEBUG	GET request to https://api.accounts.firefox.com/v1/account/device/commands?index=0
1589713193336	Sync.Resource	DEBUG	GET fail 401 https://syncserver.mondomaine.com/storage/1.5/1/info/collections
1589713193337	Sync.Resource	WARN	GET request to https://syncserver.mondomaine.com/storage/1.5/1/info/collections failed with status 401
1589713193338	Sync.Service	WARN	401: login failed.
1589713193338	Sync.BrowserIDManager	DEBUG	_findCluster has a pre-existing clusterURL, so fetching a new token token
1589713193338	FirefoxAccounts	TRACE	not checking freshness of profile as it remains recent
1589713193339	Sync.BrowserIDManager	INFO	Getting keys
1589713193340	Sync.BrowserIDManager	INFO	Getting an assertion from: https://syncserver.mondomaine.com/token/1.0/sync/1.5
1589713193341	FirefoxAccounts	DEBUG	enter getAssertion()
1589713193343	FirefoxAccounts	DEBUG	getKeypairAndCertificate: already have keyPair and certificate
1589713193343	FirefoxAccounts	DEBUG	getAssertionFromCert
1589713193345	FirefoxAccounts	DEBUG	getAssertionFromCert returning signed: true
1589713193346	Sync.BrowserIDManager	DEBUG	Getting a token
1589713193346	Services.Common.TokenServerClient	DEBUG	Beginning BID assertion exchange: https://syncserver.mondomaine.com/token/1.0/sync/1.5
1589713193347	Services.Common.RESTRequest	DEBUG	GET request to https://syncserver.mondomaine.com/token/1.0/sync/1.5
1589713193392	Services.Common.RESTRequest	DEBUG	GET https://syncserver.mondomaine.com/token/1.0/sync/1.5 200
1589713193393	Services.Common.TokenServerClient	DEBUG	Got token response: 200
1589713193394	Services.Common.TokenServerClient	DEBUG	Successful token response
1589713193394	Sync.Status	DEBUG	Status.login: success.status_ok => success.login
1589713193395	Sync.Status	DEBUG	Status.service: error.login.failed => success.status_ok
1589713193396	Sync.BrowserIDManager	DEBUG	_findCluster returning https://syncserver.mondomaine.com/storage/1.5/1/
1589713193396	Sync.BrowserIDManager	DEBUG	Cluster value = https://syncserver.mondomaine.com/storage/1.5/1/
1589713193396	Sync.Status	DEBUG	Status.login: success.login => error.login.reason.network
1589713193397	Sync.Status	DEBUG	Status.service: success.status_ok => error.login.failed
1589713193397	Sync.ErrorHandler	ERROR	Sync encountered a login error
1589713193397	Sync.SyncScheduler	DEBUG	Clearing sync triggers and the global score.
1589713193398	Sync.SyncScheduler	DEBUG	Next sync in 3600000 ms. (why=schedule)
1589713193399	FirefoxAccounts	TRACE	not checking freshness of profile as it remains recent
1589713193400	Sync.Service	DEBUG	Exception calling WrappedLock: Error: Login failed: error.login.reason.network(resource://services-sync/service.js:1041:15) JS Stack trace: onNotify@service.js:1041:15
1589713193400	Sync.Service	DEBUG	Not syncing: login returned false.
1589713193401	FirefoxAccounts	TRACE	not checking freshness of profile as it remains recent
Le serveur apache retourne aussi des erreurs, dans le fichiers acces.log:
192.168.1.254 - - [17/May/2020:12:59:53 +0200] "GET /storage/1.5/1/info/collections HTTP/1.1" 401 853 "-" "Firefox/76.0.1 (Linux x86_64) FxSync/1.78.0.20200507114007.desktop"
et dans le fichier error.log:
[Sun May 17 12:59:53.335406 2020] [wsgi:error] [pid 24502] [remote 192.168.1.254:55698] WARNING:syncstorage.views.authentication:Authentication Failed: invalid hawk id
Je dois plus être loin du but, mais là, je bute 😃
Est-ce que tu as bien modifié public_url dans la configuration de syncserver ?
Est-ce que tu as bien généré un secret partagé dans cette même configuration :
# This is a secret key used for signing authentication tokens.
# It should be long and randomly-generated.
# The following command will give a suitable value on *nix systems:
#
#    head -c 20 /dev/urandom | sha1sum
#
# If not specified then the server will generate a temporary one at startup.
#secret = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
bruno a écritEst-ce que tu as bien modifié public_url dans la configuration de syncserver ?
Est-ce que tu as bien généré un secret partagé dans cette même configuration :
# This is a secret key used for signing authentication tokens.
# It should be long and randomly-generated.
# The following command will give a suitable value on *nix systems:
#
#    head -c 20 /dev/urandom | sha1sum
#
# If not specified then the server will generate a temporary one at startup.
#secret = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Salut Bruno,
oui j'ai fait tout cela...
Donc tu confirmes que tu as bien généré une clé avec :
head -c 20 /dev/urandom | sha1sum
et que tu as quelque chose comme :
secret = 8e007cf6169a442f404f596c60bda064a3093b18
dans ton fichier syncserver .ini ?

Si c'est bien le cas tu peux essayer une des solution proposées ici : https://support.mozilla.org/ru/questions/1257742

N.B. : les logs de Firefox montrent que la connexion a fini par s'établir (code HTTP 200) :
1589713193392	Services.Common.RESTRequest	DEBUG	GET https://syncserver.mondomaine.com/token/1.0/sync/1.5 200
1589713193393	Services.Common.TokenServerClient	DEBUG	Got token response: 200

Mais ensuite il y a une erreur d’authentification :
1589713193400	Sync.Service	DEBUG	Exception calling WrappedLock: Error: Login failed:
Bonsoir Bruno,
merci à nouveau pour tes réponses.
bruno a écritDonc tu confirmes que tu as bien généré une clé avec :
head -c 20 /dev/urandom | sha1sum
et que tu as quelque chose comme :
secret = 8e007cf6169a442f404f596c60bda064a3093b18
dans ton fichier syncserver .ini ?
Oui, tout à fait, j'ai généré une clef avec la commande indiquée et je l'ai insérée dans le fichier ini.
bruno a écrit Si c'est bien le cas tu peux essayer une des solution proposées ici : https://support.mozilla.org/ru/questions/1257742
J'ai lu la page que tu m'as indiqué, j'ai fait encore plus simple: j'ai créé un nouveau profil, sans oublier de changer l'adresse identity.sync.tokenservice.uri, et en me connectant à nouveau...
Mais toujours pas de synchronisation !
J'en perd un peu mon latin !
Comme tout me semble Ok au niveau de la configuration du serveur et que l'erreur porte sur l'authentification. Je te conseille de créer un nouveau compte sur https://accounts.firefox.com
Salut Bruno,

je pense avoir trouvé l'origine du problème: en fait, vu que ce sont des certificats autosignés, avant que la synchro puisse fonctionner, il faut indiquer à Firefox d'accepter ceux-ci. Pour cela, il faut d'abord visiter la page du serveur (par ex. https://syncserver.monsite.com), et accepter les certificats.
Avant d'arriver à cette conclusion, je suis d'abord quasiment reparti de zéro (suppression de la base de donnée, création d'un compte firefox avec une autre adresse mail, création profils firefox vierge...), avant de me dire "bon sang mais c'est bien sûr".
Il ne me reste plus à configurer la tâche cron qui va bien pour lancer le serveur automatiquement.
Merci pour ton aide précieuse !

Pascal