Problème d'installation sur ubuntu server 20.04

Plus d'informations
il y a 2 ans 7 mois #25909 par alsh multisite
Bonjour,
J'ai actuellement connecthys d'installé sur un serveur ubuntu 18.04. Mais d'ici un an environ il n'y aura plus de mises à jours
J'ai donc commencé à faire des tests jusque là sans succès : mise à jour depuis une version 18.04, nouvelle installation 20.04...
Est ce qu'il y aurait quelqu'un qui a réussi à faire fonctionner connecthys sur une version 20.04 d'ubuntu (ou debian >10) ?
Je n'ai pas assez de connaissance sur python 3, mais je me demande si ce n'est pas ça le problème...
Pour info, connecthys se lance bien la première fois en attente de synchro. Mais après la première synchro, connecthys refuse de se relancer...
J'ai downgrader certaines lib pour éliminer les messages d'erreur (flask==1.1.2 jinja2==3.0.3 itsdangerous==2.0.1 Werkzeug==0.16.0 WTForms==2.3.3)
Mais je me retrouve avec un message d'erreur que je n'arrive pas à comprendre :
sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (1074, "Column length too big for column 'ventilation' (max = 16383); use BLOB or TEXT instead")

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

Plus d'informations
il y a 2 ans 7 mois #25913 par Ivan
Bonjour,

Il y a une donnée qui est trop longue par rapport à ce que j'avais prévu. Il faut donc modifier le type de la colonne "VENTILATION" de la table "PAIEMENTS" (ou "ACTIONS", ce n'est pas précisé dans le message d'erreur). Passer de VARCHAR à TEXT.

Avec deux requêtes de ce genre : 
ALTER TABLE portail_paiements MODIFY ventilation TEXT;
ALTER TABLE portail_actions MODIFY ventilation TEXT;

Ivan

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

Plus d'informations
il y a 2 ans 7 mois - il y a 2 ans 7 mois #25927 par alsh multisite
Ok merci pour votre aide.

J'ai changé le type de la colonne "VENTILATION" de la table "ACTIONS" (la table "PAIEMENTS" n'étant pas encore créée) mais cela n'a pas fonctionné.

J'ai également essayé en utilisant le fichier exemple_alsh et j'atteris sur la même erreur...

Voici le message d'erreur en entier.
C'est au moment des créations des tables pour le portail famille que ça coince ?

Lancement de Connecthys...
serveur=None host=0.0.0.0 port=5000
/home/ubuntu/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py:550: SAWarning: relationship 'Action.renseignements' will copy column portail_actions.IDaction to column portail_renseignements.IDaction, which conflicts with relationship(s): 'Renseignement.action' (copies portail_actions.IDaction to portail_renseignements.IDaction). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards.   To silence this warning, add the parameter 'overlaps="action"' to the 'Action.renseignements' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)
  mapper = orm.class_mapper(type)
/home/ubuntu/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py:550: SAWarning: relationship 'Reservation_location.action' will copy column portail_actions.IDaction to column portail_reservations_locations.IDaction, which conflicts with relationship(s): 'Action.reservations_locations' (copies portail_actions.IDaction to portail_reservations_locations.IDaction). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards.   To silence this warning, add the parameter 'overlaps="reservations_locations"' to the 'Reservation_location.action' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)
  mapper = orm.class_mapper(type)
/home/ubuntu/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py:550: SAWarning: relationship 'Periode.activite' will copy column portail_activites.IDactivite to column portail_periodes.IDactivite, which conflicts with relationship(s): 'Activite.periodes' (copies portail_activites.IDactivite to portail_periodes.IDactivite). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards.   To silence this warning, add the parameter 'overlaps="periodes"' to the 'Periode.activite' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)
  mapper = orm.class_mapper(type)
/home/ubuntu/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py:550: SAWarning: relationship 'Reservation.action' will copy column portail_actions.IDaction to column portail_reservations.IDaction, which conflicts with relationship(s): 'Action.reservations' (copies portail_actions.IDaction to portail_reservations.IDaction). If this is not the intention, consider if these relationships should be linked with back_populates, or if viewonly=True should be applied to one or more if they are read-only. For the less common case that foreign key constraints are partially overlapping, the orm.foreign() annotation can be used to isolate the columns that should be written towards.   To silence this warning, add the parameter 'overlaps="reservations"' to the 'Reservation.action' relationship. (Background on this error at: https://sqlalche.me/e/14/qzyx)
  mapper = orm.class_mapper(type)
[2022-04-04 09:55:31,718] INFO in models: Creation de la base de donnees MySQL si besoin...
[2022-04-04 09:55:31,726] INFO in models: Creation des tables des donnees...
Traceback (most recent call last):
  File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1808, in _execute_context
    self.dialect.do_execute(
  File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 732, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 209, in execute
    res = self._query(query)
  File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 315, in _query
    db.query(q)
  File "/usr/lib/python3/dist-packages/MySQLdb/connections.py", line 226, in query
    _mysql.connection.query(self, query)
MySQLdb._exceptions.OperationalError: (1074, "Column length too big for column 'ventilation' (max = 16383); use BLOB or TEXT instead")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "run.py", line 92, in <module>
    from application import app
  File "/home/ubuntu/connecthys/application/__init__.py", line 168, in <module>
    models.CreationDB()
  File "/home/ubuntu/connecthys/application/models.py", line 77, in CreationDB
    db.create_all()
  File "/home/ubuntu/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py", line 1094, in create_all
    self._execute_for_all_tables(app, bind, 'create_all')
  File "/home/ubuntu/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py", line 1086, in _execute_for_all_tables
    op(bind=self.get_engine(app, bind), **extra)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/sql/schema.py", line 4864, in create_all
    bind._run_ddl_visitor(
  File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 3123, in _run_ddl_visitor
    conn._run_ddl_visitor(visitorcallable, element, **kwargs)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2119, in _run_ddl_visitor
    visitorcallable(self.dialect, self, **kwargs).traverse_single(element)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/sql/visitors.py", line 524, in traverse_single
    return meth(obj, **kw)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py", line 849, in visit_metadata
    self.traverse_single(
  File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/sql/visitors.py", line 524, in traverse_single
    return meth(obj, **kw)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py", line 893, in visit_table
    self.connection.execute(
  File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1295, in execute
    return meth(self, multiparams, params, _EMPTY_EXECUTION_OPTS)
  File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py", line 80, in _execute_on_connection
    return connection._execute_ddl(
  File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1387, in _execute_ddl
    ret = self._execute_context(
  File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1851, in _execute_context
    self._handle_dbapi_exception(
  File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2032, in _handle_dbapi_exception
    util.raise_(
  File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 207, in raise_
    raise exception
  File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1808, in _execute_context
    self.dialect.do_execute(
  File "/home/ubuntu/.local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 732, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 209, in execute
    res = self._query(query)
  File "/usr/lib/python3/dist-packages/MySQLdb/cursors.py", line 315, in _query
    db.query(q)
  File "/usr/lib/python3/dist-packages/MySQLdb/connections.py", line 226, in query
    _mysql.connection.query(self, query)
sqlalchemy.exc.OperationalError: (MySQLdb._exceptions.OperationalError) (1074, "Column length too big for column 'ventilation' (max = 16383); use BLOB or TEXT instead")
[SQL:
CREATE TABLE portail_paiements (
        `IDpaiement` INTEGER NOT NULL AUTO_INCREMENT,
        `factures_ID` VARCHAR(50),
        `IDfamille` INTEGER,
        `IDtransaction` VARCHAR(50),
        refdet VARCHAR(50),
        montant FLOAT,
        objet VARCHAR(50),
        saisie VARCHAR(5),
        resultrans VARCHAR(5),
        numauto VARCHAR(10),
        dattrans VARCHAR(15),
        heurtrans VARCHAR(15),
        systeme_paiement VARCHAR(50),
        resultat VARCHAR(50),
        message VARCHAR(450),
        ventilation VARCHAR(100000),
        horodatage DATETIME,
        PRIMARY KEY (`IDpaiement`)
)

]
(Background on this error at: https://sqlalche.me/e/14/e3q8)
Dernière édition: il y a 2 ans 7 mois par alsh multisite.

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

Plus d'informations
il y a 1 an 8 mois - il y a 1 an 8 mois #26770 par alsh multisite
Bonjour,

Je me permets de relancer le sujet

J'ai récemment réessayé de basculer sur ubuntu server 20.04. Mais je rencontre d'autres erreurs depuis la dernière fois

Je suis parti d'une installe propre ubuntu server 20.04. Et bien connecthys se lance la première fois en attente de synchro. Mais après la première synchro, connecthys refuse de se relancer...
Lancement de Connecthys...
serveur=None 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/connecthys/connecthys/application/__init__.py", line 106, in <module>
    if db.engine.url.drivername == 'sqlite':
  File "/home/connecthys/.local/lib/python3.8/site-packages/flask_sqlalchemy/extension.py", line 658, in engine
    return self.engines[None]
  File "/home/connecthys/.local/lib/python3.8/site-packages/flask_sqlalchemy/extension.py", line 636, in engines
    app = current_app._get_current_object()  # type: ignore[attr-defined]
  File "/home/connecthys/.local/lib/python3.8/site-packages/werkzeug/local.py", line 513, in _get_current_object
    raise RuntimeError(unbound_message) from None
RuntimeError: Working outside of application context.

This typically means that you attempted to use functionality that needed
the current application. To solve this, set up an application context
with app.app_context(). See the documentation for more information.

Quelqu'un a déjà rencontré ce problème ?
J'ai essayé avec MySQL et MariaDB, sans succès...
Dernière édition: il y a 1 an 8 mois par alsh multisite.

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

Plus d'informations
il y a 1 an 8 mois #26771 par Ivan
Bonjour,

Il faudrait peut-être essayer de downgrader flask ou Flask-SQLAlchemy.

Ivan

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

Plus d'informations
il y a 1 an 8 mois #26772 par alsh multisite
Ok je vais regarder ça.
Merci

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

Plus d'informations
il y a 1 an 8 mois #26775 par alsh multisite
Avec Ubuntu 20.04 et MySQL 8.0.32
J'ai essayé de downgrader flask ou flasksqlalchemy et j'obtiens différents messages d'erreurs :

Avec flask 2.2.3 et :
flasksqlalchemy 2.3.2 et 2.4.4 :
Lancement de Connecthys...
serveur=None 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/connecthys/connecthys/application/__init__.py", line 102, in <module>
    db = SQLAlchemy(app)
  File "/home/connecthys/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py", line 676, in __init__
    self.session = self.create_scoped_session(session_options)
  File "/home/connecthys/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py", line 708, in create_scoped_session
    scopefunc = options.pop('scopefunc', _app_ctx_stack.__ident_func__)
AttributeError: '_FakeStack' object has no attribute '__ident_func__'

flaskSQLalchemy 2.5.1
Lancement de Connecthys...
serveur=None 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/connecthys/connecthys/application/__init__.py", line 102, in <module>
    db = SQLAlchemy(app)
  File "/home/connecthys/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py", line 758, in __init__
    _include_sqlalchemy(self, query_class)
  File "/home/connecthys/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py", line 112, in _include_sqlalchemy
    for key in module.__all__:
AttributeError: module 'sqlalchemy' has no attribute '__all__'

flaskSQLalchemy 3.0.0 :
Lancement de Connecthys...
serveur=None 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/connecthys/connecthys/application/__init__.py", line 106, in <module>
    if db.engine.url.drivername == 'sqlite':
  File "/home/connecthys/.local/lib/python3.8/site-packages/flask_sqlalchemy/extension.py", line 642, in engine
    return self.engines[None]
  File "/home/connecthys/.local/lib/python3.8/site-packages/flask_sqlalchemy/extension.py", line 628, in engines
    app = current_app._get_current_object()  # type: ignore[attr-defined]
  File "/home/connecthys/.local/lib/python3.8/site-packages/werkzeug/local.py", line 513, in _get_current_object
    raise RuntimeError(unbound_message) from None
RuntimeError: Working outside of application context.

This typically means that you attempted to use functionality that needed
the current application. To solve this, set up an application context
with app.app_context(). See the documentation for more information.

Avec flaskSQLalchemy 3.0.3 et :
flask 2.2.0 :
Lancement de Connecthys...
serveur=None 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/connecthys/connecthys/application/__init__.py", line 106, in <module>
    if db.engine.url.drivername == 'sqlite':
  File "/home/connecthys/.local/lib/python3.8/site-packages/flask_sqlalchemy/extension.py", line 642, in engine
    return self.engines[None]
  File "/home/connecthys/.local/lib/python3.8/site-packages/flask_sqlalchemy/extension.py", line 628, in engines
    app = current_app._get_current_object()  # type: ignore[attr-defined]
  File "/home/connecthys/.local/lib/python3.8/site-packages/werkzeug/local.py", line 513, in _get_current_object
    raise RuntimeError(unbound_message) from None
RuntimeError: Working outside of application context.

This typically means that you attempted to use functionality that needed
the current application. To solve this, set up an application context
with app.app_context(). See the documentation for more information.

Avec flaskSQLalchemy 2.5.1 et :
flask 2.1.0, flask 2.0.0 :
Lancement de Connecthys...
serveur=None 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/connecthys/connecthys/application/__init__.py", line 102, in <module>
    db = SQLAlchemy(app)
  File "/home/connecthys/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py", line 758, in __init__
    _include_sqlalchemy(self, query_class)
  File "/home/connecthys/.local/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py", line 112, in _include_sqlalchemy
    for key in module.__all__:
AttributeError: module 'sqlalchemy' has no attribute '__all__'

Avec flaskSQLalchemy 2.5.1 et :
flask 1.1.4 et flask 1.1.2 et flask 1.1.1 et flask 1.0.4 :
Lancement de Connecthys...
serveur=None 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/connecthys/connecthys/application/__init__.py", line 14, in <module>
    from flask import Flask
  File "/home/connecthys/.local/lib/python3.8/site-packages/flask/__init__.py", line 14, in <module>
    from jinja2 import escape
  File "/home/connecthys/.local/lib/python3.8/site-packages/jinja2/__init__.py", line 12, in <module>
    from .environment import Environment
  File "/home/connecthys/.local/lib/python3.8/site-packages/jinja2/environment.py", line 25, in <module>
    from .defaults import BLOCK_END_STRING
  File "/home/connecthys/.local/lib/python3.8/site-packages/jinja2/defaults.py", line 3, in <module>
    from .filters import FILTERS as DEFAULT_FILTERS  # noqa: F401
  File "/home/connecthys/.local/lib/python3.8/site-packages/jinja2/filters.py", line 13, in <module>
    from markupsafe import soft_unicode
ImportError: cannot import name 'soft_unicode' from 'markupsafe' (/home/connecthys/.local/lib/python3.8/site-packages/markupsafe/__init__.py)

Et je me suis arrêté là...

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

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