Problème lancement connecthys depuis passage 0.8.5

Plus d'informations
il y a 4 ans 1 mois #24294 par alsh multisite
Bonjour,
J'ai effectué la mise à jour de connecthys le 6/11 sur mon serveur interne. Aucun soucis sauf quand j'ai redémarré mon serveur :
Lancement de Connecthys...
serveur=tornado host=0.0.0.0 port=5000
Traceback (most recent call last):
  File "/home/user/connecthys/run.py", line 92, in <module>
    from application import app
  File "/home/user/connecthys/application/__init__.py", line 115, in <module>
    from flask_sessionstore import Session, SqlAlchemySessionInterface
ImportError: No module named flask_sessionstore
J'ai essayé de faire un pip install flask_sessionstore : OK
Ensuite j'ai obtenu une autre erreur :
Lancement de Connecthys...
serveur=tornado host=0.0.0.0 port=5000
Traceback (most recent call last):
  File "run.py", line 92, in <module>
    from application import app
  File "/home/user/connecthys/application/__init__.py", line 117, in <module>
    from captchas import MyFlaskSessionCaptcha as FlaskSessionCaptcha
  File "/home/user/connecthys/application/captchas.py", line 11, in <module>
    from flask_session_captcha import FlaskSessionCaptcha
ImportError: No module named flask_session_captcha
J'ai essayé d'installer flask_session_captcha avec pip mais j'obtiens des erreurs :
warning: no files found matching '*.c'
  warning: no files found matching '*.h'
  warning: no files found matching '*.sh'
  warning: no previously-included files found matching '.appveyor.yml'
  warning: no previously-included files found matching '.coveragerc'
  warning: no previously-included files found matching '.codecov.yml'
  warning: no previously-included files found matching '.editorconfig'
  warning: no previously-included files found matching '.readthedocs.yml'
  warning: no previously-included files found matching 'azure-pipelines.yml'
  warning: no previously-included files matching '.git*' found anywhere in distribution
  warning: no previously-included files matching '*.pyc' found anywhere in distribution
  warning: no previously-included files matching '*.so' found anywhere in distribution
  no previously-included directories found matching '.azure-pipelines'
  no previously-included directories found matching '.travis'
  writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
  running build_ext

  The headers or library files could not be found for zlib,
  a required dependency when compiling Pillow from source.

  Please see the install instructions at:
     https://pillow.readthedocs.io/en/latest/installation.html

  Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/tmp/pip-build-VKrAbA/Pillow/setup.py", line 903, in <module>
      raise RequiredDependencyException(msg)
  __main__.RequiredDependencyException:

  The headers or library files could not be found for zlib,
  a required dependency when compiling Pillow from source.

  Please see the install instructions at:
     https://pillow.readthedocs.io/en/latest/installation.html
  ----------------------------------------
  Failed building wheel for Pillow
[...]
Failed to build Pillow
[...]
 warning: no files found matching '*.c'
    warning: no files found matching '*.h'
    warning: no files found matching '*.sh'
    warning: no previously-included files found matching '.appveyor.yml'
    warning: no previously-included files found matching '.coveragerc'
    warning: no previously-included files found matching '.codecov.yml'
    warning: no previously-included files found matching '.editorconfig'
    warning: no previously-included files found matching '.readthedocs.yml'
    warning: no previously-included files found matching 'azure-pipelines.yml'
    warning: no previously-included files matching '.git*' found anywhere in distribution
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.so' found anywhere in distribution
    no previously-included directories found matching '.azure-pipelines'
    no previously-included directories found matching '.travis'
    writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
    running build_ext

 The headers or library files could not be found for zlib,
    a required dependency when compiling Pillow from source.

    Please see the install instructions at:
       https://pillow.readthedocs.io/en/latest/installation.html

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-VKrAbA/Pillow/setup.py", line 903, in <module>
        raise RequiredDependencyException(msg)
    __main__.RequiredDependencyException:

    The headers or library files could not be found for zlib,
    a required dependency when compiling Pillow from source.

    Please see the install instructions at:
       https://pillow.readthedocs.io/en/latest/installation.html
    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-VKrAbA/Pillow/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-atxNfi-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-VKrAbA/Pillow/

J'obtiens la même erreur si je fais un pip install Pillow...
Du coup, là, je cale...

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 1 mois #24296 par Ivan
Il manque la librairie zlib.
2 solutions à essayer :
sudo apt install libjpeg8-dev zlib1g-dev
pip install Pillow==6.2.2

Sinon, il faut installer la dernière version de Connecthys que je viens de mettre en ligne.

Ivan

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 1 mois - il y a 4 ans 1 mois #24298 par alsh multisite
Bonjour,
Merci beaucoup pour la première solution, j'ai pu faire un pip install flask_session_captcha sans soucis.
Mais quand j'essaie de démarrer connecthys, j'obtiens une autre erreur :
Lancement de Connecthys...
serveur=tornado host=0.0.0.0 port=5000
Traceback (most recent call last):
  File "run.py", line 92, in <module>
    from application import app
  File "/home/user/connecthys/application/__init__.py", line 126, in <module>
    captcha = FlaskSessionCaptcha(app)
  File "/home/user/connecthys/application/captchas.py", line 19, in __init__
    FlaskSessionCaptcha.__init__(self, *args, **kwargs)
  File "/home/user.local/lib/python2.7/site-packages/flask_session_captcha/__init__.py", line 12, in __init__
    self.init_app(app)
  File "/home/user/.local/lib/python2.7/site-packages/flask_session_captcha/__init__.py", line 49, in init_app
    app.session_interface.db.create_all()
  File "lib/flask_sqlalchemy/__init__.py", line 972, in create_all
    self._execute_for_all_tables(app, bind, 'create_all')
  File "lib/flask_sqlalchemy/__init__.py", line 964, in _execute_for_all_tables
    op(bind=self.get_engine(app, bind), **extra)
  File "lib/sqlalchemy/sql/schema.py", line 3695, in create_all
    tables=tables)
  File "lib/sqlalchemy/engine/base.py", line 1856, in _run_visitor
    conn._run_visitor(visitorcallable, element, **kwargs)
  File "lib/sqlalchemy/engine/base.py", line 1481, in _run_visitor
    **kwargs).traverse_single(element)
  File "lib/sqlalchemy/sql/visitors.py", line 121, in traverse_single
    return meth(obj, **kw)
  File "lib/sqlalchemy/sql/ddl.py", line 730, in visit_metadata
    _is_metadata_operation=True)
  File "lib/sqlalchemy/sql/visitors.py", line 121, in traverse_single
    return meth(obj, **kw)
  File "lib/sqlalchemy/sql/ddl.py", line 764, in visit_table
    include_foreign_key_constraints=include_foreign_key_constraints
  File "lib/sqlalchemy/engine/base.py", line 914, in execute
    return meth(self, multiparams, params)
  File "lib/sqlalchemy/sql/ddl.py", line 68, in _execute_on_connection
    return connection._execute_ddl(self, multiparams, params)
  File "lib/sqlalchemy/engine/base.py", line 968, in _execute_ddl
    compiled
  File "lib/sqlalchemy/engine/base.py", line 1146, in _execute_context
    context)
  File "lib/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
    exc_info
  File "lib/sqlalchemy/util/compat.py", line 202, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "lib/sqlalchemy/engine/base.py", line 1139, in _execute_context
    context)
  File "lib/sqlalchemy/engine/default.py", line 450, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 250, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler
    raise errorvalue
sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (1071, 'Specified key was too long; max key length is 767 bytes') [SQL: u'\nCREATE TABLE sessions (\n\tid INTEGER NOT NULL AUTO_INCREMENT, \n\tsession_id VARCHAR(255), \n\tdata TEXT, \n\texpiry DATETIME, \n\tPRIMARY KEY (id), \n\tUNIQUE (session_id)\n)\n\n']
Je vais donc essayer la 2e solution qui est d'installer la version 0.8.6 de connecthys. Mais comment s'y prendre correctement ?
Est ce que je supprime mon dossier connecthys pour remettre le nouveau à la place ? Ou est ce que j'écrase les fichiers actuels avec la nouvelle version ? Ou d'une autre manière ?
D'avance merci
Dernière édition: il y a 4 ans 1 mois par alsh multisite.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 1 mois #24299 par Ivan
Je ne pourrai pas dire d'où vient ce bug. Peut-être est-ce lié à la configuration de la base, mystère...

Mieux vaut passer sur la nouvelle version de Connecthys pour y échapper. Il suffit simplement de récupérer le fichier suivant sur Github :  https://github.com/Noethys/Connecthys/blob/master/connecthys/application/__init__.py  et d'écraser l'ancienne version de ce fichier dans le répertoire application de Connecthys.

Ivan

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 1 mois #24300 par alsh multisite
Pour la base, j'utilise MariaDB en version 10.1.47

J'ai remplacé le fichier par celui-ci https://github.com/Noethys/Connecthys/blob/master/connecthys/application/__init__.py mais je me retrouve avec toujours une erreur :
Lancement de Connecthys...
serveur=tornado host=0.0.0.0 port=5000
[2020-11-11 22:47:26,080] INFO in __init__: flask_sessionstore non fonctionnel
Traceback (most recent call last):
  File "run.py", line 92, in <module>
    from application import app
  File "/home/user/connecthys/application/__init__.py", line 148, in <module>
    from flask_wtf.csrf import CsrfProtect as CSRFProtect
  File "lib/flask_wtf/__init__.py", line 5, in <module>
    from .recaptcha import *
  File "lib/flask_wtf/recaptcha/__init__.py", line 2, in <module>
    from .fields import *
  File "lib/flask_wtf/recaptcha/fields.py", line 3, in <module>
    from . import widgets
  File "lib/flask_wtf/recaptcha/widgets.py", line 4, in <module>
    from werkzeug import url_encode
ImportError: cannot import name url_encode

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 1 mois #24301 par Ivan
Bonjour,

En essayant ceci peut-être :
pip install werkzeug==0.16.0

Ivan

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 1 mois #24304 par alsh multisite
Bonjour,
Merci pour la nouvelle instruction.
Il a fallu que je fasse un pip install python-dateutil en plus. Maintenant j'ai une nouvelle erreur.
Voilà ce que j'ai obtenu au premier démarrage de connecthys :
Lancement de Connecthys...
serveur=tornado host=0.0.0.0 port=5000
[2020-11-12 09:59:16,743] INFO in __init__: flask_sessionstore non fonctionnel
[2020-11-12 09:59:17,280] INFO in models: Migration de la base de donnees...
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.autogenerate.compare] Detected added table 'sessions'
INFO  [alembic.autogenerate.compare] Detected type change from MEDIUMTEXT() to String(length=100000) on 'portail_actions.ventilation'
INFO  [alembic.autogenerate.compare] Detected type change from MEDIUMTEXT() to String(length=100000) on 'portail_blocs.parametres'
INFO  [alembic.autogenerate.compare] Detected type change from MEDIUMTEXT() to String(length=100000) on 'portail_elements.parametres'
INFO  [alembic.autogenerate.compare] Detected type change from MEDIUMTEXT() to String(length=100000) on 'portail_elements.texte_html'
INFO  [alembic.autogenerate.compare] Detected type change from MEDIUMTEXT() to String(length=100000) on 'portail_paiements.ventilation'
  Generating /home/user/connecthys/migrations/versions/54fe45deac5d_.py ... done
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running upgrade  -> 54fe45deac5d, empty message
ERROR [tornado.access] 500 GET / (86.217.0.244) 33.96ms
ERROR [tornado.access] 500 GET /favicon.ico (86.217.0.244) 22.39ms
J'ai arrêté et relancé connecthys. Et j'ai l'impression que le portail se lance bien, mais j'obtiens cette erreur à la consultation de la page :
Traceback (most recent call last):  File "/home/user/.local/lib/python2.7/site-packages/flask/app.py", line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/user/.local/lib/python2.7/site-packages/flask/app.py", line 1953, in full_dispatch_request
    return self.finalize_request(rv)
  File "/home/user/.local/lib/python2.7/site-packages/flask/app.py", line 1970, in finalize_request
    response = self.process_response(response)
  File "/home/user/.local/lib/python2.7/site-packages/flask/app.py", line 2269, in process_response
    self.session_interface.save_session(self, ctx.session, response)
  File "/home/user/.local/lib/python2.7/site-packages/flask_sessionstore/sessions.py", line 538, in save_session
    session_id=store_id).first()
  File "lib/sqlalchemy/orm/query.py", line 2659, in first
    ret = list(self[0:1])
  File "lib/sqlalchemy/orm/query.py", line 2457, in __getitem__
    return list(res)
  File "lib/sqlalchemy/orm/query.py", line 2761, in __iter__
    return self._execute_and_instances(context)
  File "lib/sqlalchemy/orm/query.py", line 2776, in _execute_and_instances
    result = conn.execute(querycontext.statement, self._params)
  File "lib/sqlalchemy/engine/base.py", line 914, in execute
    return meth(self, multiparams, params)
  File "lib/sqlalchemy/sql/elements.py", line 323, in _execute_on_connection
    return connection._execute_clauseelement(self, multiparams, params)
  File "lib/sqlalchemy/engine/base.py", line 1010, in _execute_clauseelement
    compiled_sql, distilled_params
  File "lib/sqlalchemy/engine/base.py", line 1146, in _execute_context
    context)
  File "lib/sqlalchemy/engine/base.py", line 1341, in _handle_dbapi_exception
    exc_info
  File "lib/sqlalchemy/util/compat.py", line 202, in raise_from_cause
    reraise(type(exception), exception, tb=exc_tb, cause=cause)
  File "lib/sqlalchemy/engine/base.py", line 1139, in _execute_context
    context)
  File "lib/sqlalchemy/engine/default.py", line 450, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 250, in execute
    self.errorhandler(self, exc, value)
  File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 50, in defaulterrorhandler
    raise errorvalue
ProgrammingError: (_mysql_exceptions.ProgrammingError) (1146, "Table 'alsh.sessions' doesn't exist") [SQL: u'SELECT sessions.id AS sessions_id, sessions.session_id AS sessions_session_id, sessions.data AS sessions_data, sessions.expiry AS sessions_expiry \nFROM sessions \nWHERE sessions.session_id = %s \n LIMIT %s'] [parameters: ('session:deaea8c6-2c6d-4699-a2c1-08a11693d67b', 1)]

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 1 mois #24305 par Ivan
Décidément !
Il n'a pas réussi à créer la table "sessions". C'est un problème dans les migrations. Le module de gestion des migrations est assez sensible et peut planter rapidement dans certaines situations. 
Peut-être en essayant de réparer la base depuis Noethys : Menu Outils > Connecthys > Bouton Outils > Réparer.

Ivan

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 1 mois - il y a 4 ans 1 mois #24307 par alsh multisite

Tout d'abord merci pour tout le temps et les conseils donnés.
Malheureusement cela ne fonctionne toujours pas. J'obtiens une erreur dans noethys en essayant la réparation :
[12/11/20 12:14:53] Demande de réparation de la base de données...
[12/11/20 12:14:53] [Erreur] Erreur dans la demande de réparation DB
[12/11/20 12:14:53] HTTP Error 500: INTERNAL SERVER ERROR
Et voilà ce que  la demande de réparation m'a affiché du côté du serveur :
[2020-11-12 12:14:53,979] DEBUG in views: Demande repairdb.
DEBUG:application:Demande repairdb.
[2020-11-12 12:14:53,980] INFO in models: Tentative de reparation de la DB
INFO:application:Tentative de reparation de la DB
[2020-11-12 12:14:53,981] INFO in models: Suppression table alembic_version...
INFO:application:Suppression table alembic_version...
[2020-11-12 12:14:53,992] INFO in models: Suppression du repertoire migrations...
INFO:application:Suppression du repertoire migrations...
  Creating directory /home/user/connecthys/migrations ... done
  Creating directory /home/user/connecthys/migrations/versions ... done
  Generating /home/user/connecthys/migrations/alembic.ini ... done
  Generating /home/user/connecthys/migrations/env.py ... done
  Generating /home/user/connecthys/migrations/script.py.mako ... done
  Please edit configuration/connection/logging settings in '/home/user/connecthys/migrations/alembic.ini' before proceeding.
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.autogenerate.compare] Detected added table 'sessions'
INFO  [alembic.autogenerate.compare] Detected added table 'portail_inscriptions'
INFO  [alembic.autogenerate.compare] Detected added index 'ix_portail_inscriptions_IDfamille' on '['IDfamille']'
INFO  [alembic.autogenerate.compare] Detected added index 'ix_portail_inscriptions_IDindividu' on '['IDindividu']'
INFO  [alembic.autogenerate.compare] Detected added table 'portail_periodes'
INFO  [alembic.autogenerate.compare] Detected added table 'portail_unites'
INFO  [alembic.autogenerate.compare] Detected type change from MEDIUMTEXT() to String(length=100000) on 'portail_actions.ventilation'
INFO  [alembic.autogenerate.compare] Detected type change from MEDIUMTEXT() to String(length=100000) on 'portail_blocs.parametres'
INFO  [alembic.autogenerate.compare] Detected type change from MEDIUMTEXT() to String(length=100000) on 'portail_elements.parametres'
INFO  [alembic.autogenerate.compare] Detected type change from MEDIUMTEXT() to String(length=100000) on 'portail_elements.texte_html'
INFO  [alembic.autogenerate.compare] Detected type change from MEDIUMTEXT() to String(length=100000) on 'portail_paiements.ventilation'
  Generating /home/user/connecthys/migrations/versions/1f6d1677ba39_.py ... done
INFO  [alembic.runtime.migration] Context impl MySQLImpl.
INFO  [alembic.runtime.migration] Will assume non-transactional DDL.
INFO  [alembic.runtime.migration] Running stamp_revision  -> 1f6d1677ba39
Et j'ai toujours la même erreur indiqué précédemment qui s'affiche sur la page du portail famille...
Dernière édition: il y a 4 ans 1 mois par alsh multisite.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 4 ans 1 mois #24308 par Ivan
J'ai une petite idée mais il me sera compliqué d'expliquer. Il faudrait que je fasse une téléassistance. Est-il possible de faire ça aujourd'hui à 17h30 ?

Connexion ou Créer un compte pour participer à la conversation.

Temps de génération de la page : 0.237 secondes
Propulsé par Kunena