Actually, this issue may be related to a boto3 / moto upgrade. Please 
disregard until I investigate further.

On Monday, August 27, 2018 at 8:49:36 AM UTC-7, Curtis Castrapel wrote:
>
> Hi,
>
> I have an odd issue with sqlachemy==1.2.11 that I haven't seen before. My 
> unit tests were failing locally after the upgrade for Lemur ( 
> https://github.com/Netflix/lemur/ ) . When I test locally, tests pass 
> fine with sqlachemy==1.2.10, but fail with sqlachemy==1.2.11 . 
>
> Here is the travis CI: 
> https://travis-ci.org/Netflix/lemur/builds/421142451
>
> The table it's complaining about is defined here: 
> https://github.com/Netflix/lemur/blob/master/lemur/dns_providers/schemas.py 
> . It could certainly be an error with the schema, but it's odd to me that I 
> am not able to reproduce this error on earlier versions. Could this be 
> related to the newline I see in the traceback below? ' \nFROM 
> dns_providers' ? 
>
> I can run the query defined below on the Postgres database directly 
> (without the \n character) without any issues: 'SELECT dns_providers.id 
> AS dns_providers_id, dns_providers.name AS dns_providers_name, 
> dns_providers.description AS dns_providers_description, 
> dns_providers.provider_type AS dns_providers_provider_type, 
> dns_providers.credentials AS dns_providers_credentials, 
> dns_providers.api_endpoint AS dns_providers_api_endpoint, 
> dns_providers.date_created AS dns_providers_date_created, 
> dns_providers.status AS dns_providers_status, dns_providers.options AS 
> dns_providers_options, dns_providers.domains AS dns_providers_domains FROM 
> dns_providers'
>
> Here's an excerpt from the traceback:
>
> "Traceback (most recent call last):
>   File "/Users/ccastrapel/localrepos/lemur/lemur/common/managers.py", line 
> 60, in all
>     results.append(cls())
>   File 
> "/Users/ccastrapel/localrepos/lemur/lemur/plugins/lemur_acme/plugin.py", 
> line 332, in __init__
>     self.acme = AcmeHandler()
>   File 
> "/Users/ccastrapel/localrepos/lemur/lemur/plugins/lemur_acme/plugin.py", 
> line 47, in __init__
>     self.all_dns_providers = dns_provider_service.get_all_dns_providers()
>   File 
> "/Users/ccastrapel/localrepos/lemur/lemur/dns_providers/service.py", line 
> 31, in get_all_dns_providers
>     return DnsProvider.query.all()
>   File 
> "/Users/ccastrapel/localrepos/lemur/env/lib/python3.7/site-packages/sqlalchemy/orm/query.py",
>  
> line 2836, in all
>     return list(self)
>   File 
> "/Users/ccastrapel/localrepos/lemur/env/lib/python3.7/site-packages/sqlalchemy/orm/query.py",
>  
> line 2988, in __iter__
>     return self._execute_and_instances(context)
>   File 
> "/Users/ccastrapel/localrepos/lemur/env/lib/python3.7/site-packages/sqlalchemy/orm/query.py",
>  
> line 3011, in _execute_and_instances
>     result = conn.execute(querycontext.statement, self._params)
>   File 
> "/Users/ccastrapel/localrepos/lemur/env/lib/python3.7/site-packages/sqlalchemy/engine/base.py",
>  
> line 948, in execute
>     return meth(self, multiparams, params)
>   File 
> "/Users/ccastrapel/localrepos/lemur/env/lib/python3.7/site-packages/sqlalchemy/sql/elements.py",
>  
> line 269, in _execute_on_connection
>     return connection._execute_clauseelement(self, multiparams, params)
>   File 
> "/Users/ccastrapel/localrepos/lemur/env/lib/python3.7/site-packages/sqlalchemy/engine/base.py",
>  
> line 1060, in _execute_clauseelement
>     compiled_sql, distilled_params
>   File 
> "/Users/ccastrapel/localrepos/lemur/env/lib/python3.7/site-packages/sqlalchemy/engine/base.py",
>  
> line 1200, in _execute_context
>     context)
>   File 
> "/Users/ccastrapel/localrepos/lemur/env/lib/python3.7/site-packages/sqlalchemy/engine/base.py",
>  
> line 1413, in _handle_dbapi_exception
>     exc_info
>   File 
> "/Users/ccastrapel/localrepos/lemur/env/lib/python3.7/site-packages/sqlalchemy/util/compat.py",
>  
> line 265, in raise_from_cause
>     reraise(type(exception), exception, tb=exc_tb, cause=cause)
>   File 
> "/Users/ccastrapel/localrepos/lemur/env/lib/python3.7/site-packages/sqlalchemy/util/compat.py",
>  
> line 248, in reraise
>     raise value.with_traceback(tb)
>   File 
> "/Users/ccastrapel/localrepos/lemur/env/lib/python3.7/site-packages/sqlalchemy/engine/base.py",
>  
> line 1193, in _execute_context
>     context)
>   File 
> "/Users/ccastrapel/localrepos/lemur/env/lib/python3.7/site-packages/sqlalchemy/engine/default.py",
>  
> line 509, in do_execute
>     cursor.execute(statement, parameters)
> sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) relation 
> "dns_providers" does not exist
> LINE 2: FROM dns_providers
>              ^
>  [SQL: 'SELECT dns_providers.id AS dns_providers_id, dns_providers.name 
> AS dns_providers_name, dns_providers.description AS 
> dns_providers_description, dns_providers.provider_type AS 
> dns_providers_provider_type, dns_providers.credentials AS 
> dns_providers_credentials, dns_providers.api_endpoint AS 
> dns_providers_api_endpoint, dns_providers.date_created AS 
> dns_providers_date_created, dns_providers.status AS dns_providers_status, 
> dns_providers.options AS dns_providers_options, dns_providers.domains AS 
> dns_providers_domains \nFROM dns_providers'] (Background on this error at: 
> http://sqlalche.me/e/f405)"
>
>
> Thanks,
> Curtis
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to