Project

General

Profile

Demande #20277

Problème control-vnc

Added by Philippe Caseiro over 4 years ago. Updated 4 months ago.

Status:
Fermé
Priority:
Haut
Assigned To:
Category:
-
Target version:
-
Start date:
04/18/2017
Due date:
% Done:

0%

Spent time:

Description

Bonjour

Constaté actuellement sur les plus gros établissements de Nouvelle-Calédonie :
2017/03/29 23:22:32  [Broker,5077,10.198.8.126] Appel de la fonction remote_service_start par 10.198.8.126 : 115P02 (Vista), mac=70:5A:0F:32:13:E6
2017/03/29 23:22:32  [Broker,5077,10.198.8.126] Peer will receive following PB traceback:
2017/03/29 23:22:32  [Broker,5077,10.198.8.126] Unhandled Error
    Traceback (most recent call last):
      File "/usr/lib/python2.7/dist-packages/twisted/spread/banana.py", line 153, in gotItem
        self.callExpressionReceived(item)
      File "/usr/lib/python2.7/dist-packages/twisted/spread/banana.py", line 116, in callExpressionReceived
        self.expressionReceived(obj)
      File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 565, in expressionReceived
        method(*sexp[1:])
      File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 877, in proto_message
        self._recvMessage(self.localObjectForID, requestID, objectID, message, answerRequired, netArgs, netKw)
    --- <exception caught here> ---
      File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 891, in _recvMessage
        netResult = object.remoteMessageReceived(self, message, netArgs, netKw)
      File "/usr/share/eole/controlevnc/controle_vnc_serveur.py", line 67, in remoteMessageReceived
        return pb.Root.remoteMessageReceived(self, broker, message, args, kw)
      File "/usr/lib/python2.7/dist-packages/twisted/spread/flavors.py", line 114, in remoteMessageReceived
        state = method(*args, **kw)
      File "/usr/share/eole/controlevnc/controle_vnc_serveur.py", line 315, in remote_service_start
        return Connexions().service_start(self.ip, mac)
      File "/usr/share/eole/controlevnc/connexions.py", line 182, in __init__
        passwd=mysql_password, db='controlevnc')
      File "/usr/lib/python2.7/dist-packages/MySQLdb/__init__.py", line 81, in Connect
        return Connection(*args, **kwargs)
      File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 187, in __init__
        super(Connection, self).__init__(*args, **kwargs2)
    _mysql_exceptions.OperationalError: (1045, "Access denied for user 'controlevnc'@'localhost' (using password: YES)")

Lors des périodes de fortes activités cette erreur apparait dans les logs après une relance du service controle-vnc le message n'est plus plus dans les logs.

History

#1 Updated by Klaas TJEBBES over 4 years ago

  • Status changed from Nouveau to En attente d'informations
  • Assigned To set to Klaas TJEBBES

Problème d'authentification du démon controle-vnc lors d'une tentative d'accès à sa base de données MySQL :

    _mysql_exceptions.OperationalError: (1045, "Access denied for user 'controlevnc'@'localhost' (using password: YES)")

Le mot de passe MySQL/controlevnc est visiblement désynchronisé ("using password: YES" mais "Access denied").

Une cause peut être que

mysql_pwd.py

a été utilisé en dehors de reconfigure. Dans ce cas le mot de passe de la base a été modifié mais sans redémarrage du service controle-vnc qui n'a donc pas pris en compte ce nouveau mot de passe.

Les logs datent de fin mars, le problème apparaît-il toujours ?

#2 Updated by Klaas TJEBBES over 4 years ago

  • Status changed from En attente d'informations to Fermé

À ré-ouvrir si le problème persiste.

En théorie, reconfigure aurait du régler le problème de mot de passe MySQL/controlevnc désynchronisé.

#3 Updated by Vincent Febvre over 3 years ago

Sur une 2.5.2 à jour, le problème est toujours d'actualité :

ci-dessous le traceback sur un serveur de Nouvelle-Calédonie :

2018/03/12 08:14:59  [Broker,18207,10.198.20.175] Peer will receive following PB traceback:
2018/03/12 08:14:59  [Broker,18207,10.198.20.175] Unhandled Error
    Traceback (most recent call last):
      File "/usr/lib/python2.7/dist-packages/twisted/spread/banana.py", line 153, in gotItem
        self.callExpressionReceived(item)
      File "/usr/lib/python2.7/dist-packages/twisted/spread/banana.py", line 116, in callExpressionReceived
        self.expressionReceived(obj)
      File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 565, in expressionReceived
        method(*sexp[1:])
      File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 877, in proto_message
        self._recvMessage(self.localObjectForID, requestID, objectID, message, answerRequired, netArgs, netKw)
    --- <exception caught here> ---
      File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 891, in _recvMessage
        netResult = object.remoteMessageReceived(self, message, netArgs, netKw)
      File "/usr/share/eole/controlevnc/controle_vnc_serveur.py", line 67, in remoteMessageReceived
        return pb.Root.remoteMessageReceived(self, broker, message, args, kw)
      File "/usr/lib/python2.7/dist-packages/twisted/spread/flavors.py", line 114, in remoteMessageReceived
        state = method(*args, **kw)
      File "/usr/share/eole/controlevnc/controle_vnc_serveur.py", line 315, in remote_service_start
        return Connexions().service_start(self.ip, mac)
      File "/usr/share/eole/controlevnc/connexions.py", line 183, in __init__
        passwd=mysql_password, db='controlevnc')
      File "/usr/lib/python2.7/dist-packages/MySQLdb/__init__.py", line 81, in Connect
        return Connection(*args, **kwargs)
      File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 187, in __init__
        super(Connection, self).__init__(*args, **kwargs2)
    _mysql_exceptions.OperationalError: (1045, "Access denied for user 'controlevnc'@'localhost' (using password: YES)")

#4 Updated by david kerjoant 4 months ago

Bonjour,
Ce problème est de nouveau d'actualité sur un Scribe 2.6.2 :

2021-05-21T07:38:00.972766+11:00 scribe.coeur.lan controle-vnc2145: 2021/05/21 07:38:00 [Broker,2280,10.107.217.103] Appel de la fonction remote_service_start par 10.107.217.103 : WIN10-SALLE07 (Vista), mac=1C:69:7A:09:87:BB
2021-05-21T07:38:00.973358+11:00 scribe.coeur.lan controle-vnc2145: 2021/05/21 07:38:00 [Broker,2280,10.107.217.103] Peer will receive following PB traceback:
2021-05-21T07:38:00.973784+11:00 scribe.coeur.lan controle-vnc2145: 2021/05/21 07:38:00 [Broker,2280,10.107.217.103] Unhandled Error
2021-05-21T07:38:00.973914+11:00 scribe.coeur.lan controle-vnc2145: #011Traceback (most recent call last):
2021-05-21T07:38:00.973998+11:00 scribe.coeur.lan controle-vnc2145: #011 File "/usr/lib/python2.7/dist-packages/twisted/spread/banana.py", line 167, in gotItem
2021-05-21T07:38:00.974078+11:00 scribe.coeur.lan controle-vnc2145: #011 self.callExpressionReceived(item)
2021-05-21T07:38:00.974161+11:00 scribe.coeur.lan controle-vnc2145: #011 File "/usr/lib/python2.7/dist-packages/twisted/spread/banana.py", line 130, in callExpressionReceived
2021-05-21T07:38:00.974262+11:00 scribe.coeur.lan controle-vnc2145: #011 self.expressionReceived(obj)
2021-05-21T07:38:00.974339+11:00 scribe.coeur.lan controle-vnc2145: #011 File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 563, in expressionReceived
2021-05-21T07:38:00.974409+11:00 scribe.coeur.lan controle-vnc2145: #011 method(*sexp[1:])
2021-05-21T07:38:00.974478+11:00 scribe.coeur.lan controle-vnc2145: #011 File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 875, in proto_message
2021-05-21T07:38:00.974548+11:00 scribe.coeur.lan controle-vnc2145: #011 self._recvMessage(self.localObjectForID, requestID, objectID, message, answerRequired, netArgs, netKw)
2021-05-21T07:38:00.974617+11:00 scribe.coeur.lan controle-vnc2145: #011--- <exception caught here> ---
2021-05-21T07:38:00.974686+11:00 scribe.coeur.lan controle-vnc2145: #011 File "/usr/lib/python2.7/dist-packages/twisted/spread/pb.py", line 889, in recvMessage
2021-05-21T07:38:00.974754+11:00 scribe.coeur.lan controle-vnc2145: #011 netResult = object.remoteMessageReceived(self, message, netArgs, netKw)
2021-05-21T07:38:00.974823+11:00 scribe.coeur.lan controle-vnc2145: #011 File "/usr/share/eole/controlevnc/controle_vnc_serveur.py", line 67, in remoteMessageReceived
2021-05-21T07:38:00.974892+11:00 scribe.coeur.lan controle-vnc2145: #011 return pb.Root.remoteMessageReceived(self, broker, message, args, kw)
2021-05-21T07:38:00.974965+11:00 scribe.coeur.lan controle-vnc2145: #011 File "/usr/lib/python2.7/dist-packages/twisted/spread/flavors.py", line 114, in remoteMessageReceived
2021-05-21T07:38:00.975034+11:00 scribe.coeur.lan controle-vnc2145: #011 state = method(*args, **kw)
2021-05-21T07:38:00.975103+11:00 scribe.coeur.lan controle-vnc2145: #011 File "/usr/share/eole/controlevnc/controle_vnc_serveur.py", line 315, in remote_service_start
2021-05-21T07:38:00.975175+11:00 scribe.coeur.lan controle-vnc2145: #011 return Connexions().service_start(self.ip, mac)
2021-05-21T07:38:00.975245+11:00 scribe.coeur.lan controle-vnc2145: #011 File "/usr/share/eole/controlevnc/connexions.py", line 183, in init
2021-05-21T07:38:00.975313+11:00 scribe.coeur.lan controle-vnc2145: #011 passwd=mysql_password, db='controlevnc')
2021-05-21T07:38:00.975383+11:00 scribe.coeur.lan controle-vnc2145: #011 File "/usr/lib/python2.7/dist-packages/MySQLdb/
_init__.py", line 81, in Connect
2021-05-21T07:38:00.975453+11:00 scribe.coeur.lan controle-vnc2145: #011 return Connection(*args, **kwargs)
2021-05-21T07:38:00.975524+11:00 scribe.coeur.lan controle-vnc2145: #011 File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 204, in init
2021-05-21T07:38:00.975594+11:00 scribe.coeur.lan controle-vnc2145: #011 super(Connection, self).__init__(*args, **kwargs2)
2021-05-21T07:38:00.975663+11:00 scribe.coeur.lan controle-vnc2145: #011_mysql_exceptions.OperationalError: (1045, "Access denied for user 'controlevnc'@'localhost' (using password: YES)")

Auriez-vous une solution ?
D'avance merci

#5 Updated by david kerjoant 4 months ago

Le problème a été ponctuellement résolu avec cette méthode :
ps aux | grep vnc
kill -9 PIDvnc
service controle-vnc start

Comme le problème perdure depuis 4 ans (Bravo Philippe ;)) avez-vous des pistes ? Je suis également étonné de voir ce problème sur un Scribe 2.6.2 car je ne l'avais pas vu depuis les 2.5.2.
Bon courage et merci pour tout !

#6 Updated by Laurent Couillaud 4 months ago

Bonjour David,
Nous avons trouver un palliatif temporaire automatisé :
Un script qui est lancé toutes les 5 min pour vérifier l'état et procéder à la relance du service.

La ligne du cron :
*/5 * * * * root /usr/bin/dsi/auto_restart_controle-vnc.sh >> /tmp/auto_restart_controle-vnc.log 2>&1

Le script :
#!/bin/bash

#########################################################################################
  1. Par: Jean MAHOT - BISR
  2. Desc: Ce script verifie les 500 dernieres lignes du fichier de log de controle-vnc
  3. et si une erreur est detectée et que l'erreur a eu lieu il y a moins de 4 minutes
  4. alors le processus de controle-vnc est tué et le service est redémarré #########################################################################################
    echo "Log: `date '+%Y-%m-%d %H:%M'`"
    lines=`/usr/bin/tail -n 500 /var/log/rsyslog/local/controle-vnc/controle-vnc.info.log`
    now_minus_5m=`/bin/date '+%s' --date="4 minutes ago"`

convert_date_log_to_timestamp(){
log_line="$1"
date_log_Ymd=`echo $log_line | cut -c1-10`
date_log_HM=`echo $log_line | cut -c12-16`
timestamp_log=`/bin/date -d "$date_log_Ymd $date_log_HM" '+%s' `
}

IFS_old=$IFS
IFS=$'\n'
for line in $lines; do
if "$line" =~ "Unhandled Error" ; then
echo $line
convert_date_log_to_timestamp $line
if [ $timestamp_log -gt $now_minus_5m ]; then
pid_vnc=`/bin/ps aux | /bin/grep controle-vnc | /bin/grep "python" | /usr/bin/awk '{print $2}'`
echo "/bin/kill -9 $pid_vnc"
echo "/usr/sbin/service controle-vnc restart"
/bin/kill -9 $pid_vnc && /usr/sbin/service controle-vnc restart
sleep 10
pid_vnc=`/bin/ps aux | /bin/grep controle-vnc | /bin/grep "python" | /usr/bin/awk '{print $2}'`
if [ -z "$pid_vnc" ]; then
echo "/usr/sbin/service controle-vnc restart"
/usr/sbin/service controle-vnc restart
fi
exit
fi
fi
done
IFS=$IFS_old

Si ça peut t'aider. Nous on l'a déployé par zéphir dans une variante pour qu'il se mette en place.
Attention, penser à passer le script en chmod u+x sur le zephir quand tu l'as ajouté pour qu'il soit exécutable aussi sur les Scribe.

Bonne journée.
En espérant qu'une solution soit trouvé.
Cordialement,
Laurent Couillaud
DSI du Vice-Rectorat de Nouvelle Calédonie

Also available in: Atom PDF