Malformed packet Problem with Mysql 5.7

670 views
Skip to first unread message

Bruno Ramos

unread,
Jul 23, 2018, 7:13:16 PM7/23/18
to sqlalchemy
Hello guys, 
I have an api that was made over python 3.5 with SQLAlchemy==1.2.10
My api connects to a RDS Aurora with mysql engine 5.7. 

In the api i have a get method that when executed return some lines from my database. When i run the api local pointing out
to rds every think works fine, but when the i try to execute the same get method deployed into Amazon Ecs, i get the follow error. 

sqlalchemy.exc.OperationalError

sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (2027, 'Malformed packet') [SQL: 'SELECT compra.compra_id AS compra_compra_id, compra.cnpj_cliente AS compra_cnpj_cliente, compra.nome_cliente AS compra_nome_cliente, compra.cnpj_agencia AS compra_cnpj_agencia, compra.nome_agencia AS compra_nome_agencia, compra.contato_atendimento AS compra_contato_atendimento, compra.assistente AS compra_assistente, compra.player AS compra_player, compra.cliente_direto AS compra_cliente_direto, compra.status AS compra_status, compra.tipo AS compra_tipo, compra.dt_criacao AS compra_dt_criacao, compra.dt_atualizacao AS compra_dt_atualizacao \nFROM compra \n LIMIT %s, %s'] [parameters: (0, 50)] (Background on this error at: http://sqlalche.me/e/e3q8)




I just have one difference between the environments, local o call the get over http and on ecs i call over https. 

I have attached my requirements.txt

Regards
requirements.txt

Mike Bayer

unread,
Jul 23, 2018, 11:02:32 PM7/23/18
to sqlal...@googlegroups.com
On Mon, Jul 23, 2018 at 7:13 PM, Bruno Ramos <bruno...@gmail.com> wrote:
> Hello guys,
> I have an api that was made over python 3.5 with SQLAlchemy==1.2.10
> My api connects to a RDS Aurora with mysql engine 5.7.
>
> In the api i have a get method that when executed return some lines from my
> database. When i run the api local pointing out
> to rds every think works fine, but when the i try to execute the same get
> method deployed into Amazon Ecs, i get the follow error.
>
> sqlalchemy.exc.OperationalError
>
> sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (2027,
> 'Malformed packet') [SQL: 'SELECT compra.compra_id AS compra_compra_id,
> compra.cnpj_cliente AS compra_cnpj_cliente, compra.nome_cliente AS
> compra_nome_cliente, compra.cnpj_agencia AS compra_cnpj_agencia,
> compra.nome_agencia AS compra_nome_agencia, compra.contato_atendimento AS
> compra_contato_atendimento, compra.assistente AS compra_assistente,
> compra.player AS compra_player, compra.cliente_direto AS
> compra_cliente_direto, compra.status AS compra_status, compra.tipo AS
> compra_tipo, compra.dt_criacao AS compra_dt_criacao, compra.dt_atualizacao
> AS compra_dt_atualizacao \nFROM compra \n LIMIT %s, %s'] [parameters: (0,
> 50)] (Background on this error at: http://sqlalche.me/e/e3q8)
>
>
> Link to the api:
> https://globoexpress.cluster.stg.negocios.tvglobo.com.br/compras/api/v1/Order/


this error is related to the client driver and googling suggests there
is some change in the authentication protocol that might be involved,
I see you are on the latest mysqlclient you'll want to get a complete
stack trace and post a bug report at
https://github.com/PyMySQL/mysqlclient-python.





>
>
> I just have one difference between the environments, local o call the get
> over http and on ecs i call over https.
>
> I have attached my requirements.txt
>
> Regards
>
> --
> SQLAlchemy -
> The Python SQL Toolkit and Object Relational Mapper
>
> http://www.sqlalchemy.org/
>
> To post example code, please provide an MCVE: Minimal, Complete, and
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full
> description.
> ---
> You received this message because you are subscribed to the Google Groups
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sqlalchemy+...@googlegroups.com.
> To post to this group, send email to sqlal...@googlegroups.com.
> Visit this group at https://groups.google.com/group/sqlalchemy.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages