Non-reproducible SQL access control error in Snowflake - pandas

I'm facing a non-reproducible SQL error with Snowflake. I run a scheduled job on Databricks which writes to a snowflake table. Sometimes I get SQL access control error which is very strange given that I've required access level and the job succeeds sometimes. There isn't much literature on this issue apart from the error definition on SQLAlechemy. Below I've pasted the error with sensitive details obscured. I haven't been able to find the root cause of this error.
-> df_temp.to_sql("table_name", con3, if_exists='append', index=False, index_label=None)
ProgrammingError: (snowflake.connector.errors.ProgrammingError) 003001 (42501): SQL access control error:
Insufficient privileges to operate on table 'TABLE_NAME'
[SQL: INSERT INTO table_name (index, YYYYYXXXXX]
[parameters: XXXX]
(Background on this error at: `https://sqlalche.me/e/14/f405`)

Related

DataGrip only executing first 19 lines of SQL query

I'm attempting to execute a 236 line query in DataGrip in an attached BigQuery console. When I select the whole script to run, it always only executes up to the 19th line. Because of that, I get this error
[HY000][100032] [Simba][BigQueryJDBCDriver](100032) Error executing query job. Message: Syntax error: Unexpected end of script at [19:49] com.simba.googlebigquery.support.exceptions.GeneralException: [Simba][BigQueryJDBCDriver](100032) Error executing query job. Message: Syntax error: Unexpected end of script at [19:49]
I've tried running it as a SQL file as well, but that resulted in the same error. I Know that this query is valid because it returns the desired results when I run it directly in the Google Cloud query editor. Has anyone else run into this issue, and is there a fix?
We introduced BigQuery dialect recently and it does not apply to your previously created data source after update, since this data source was created with custom driver with 'Generic' dialect as default. It is needed to change dialect in driver options, then you'll have all related consoles and datasources with correct one.

"An error occurred while extracting the result into a variable of type (DBTYPE_I2)"

I am getting below error in production instance. There were no changes to the ETL and the job was running all OK everyday. Today suddenly it has started failing with error:
Source: SQL Update Audit Table Processing Execute SQL Task Description: Executing the query "UPDATE AuditTableProcessing SET ExtractRowCnt = ?..." failed with the following error: "An error occurred while extracting the result into a variable of type (DBTYPE_I2)"
When I run the job in development environment everything runs smoothly without an issue. Any hints on the issue will be much helpful!
It looks like that there are a Variable Mapped in the ResultSet of the Execute SQL Task is of type DBTYPE_I2 and the value does not fit theis type, try changing it to DBTYPE_I4 or relevant data type.
More information about ResulSet:
SSIS Basics: Using the Execute SQL Task to Generate Result Sets

What causes error "Procedure unknown"

So at my company we use a billing system which connects to a Firebird database that we have no back-end access to. I am quite new at this company so my familiarity with the Firebird database is not too great. We keep getting this error :
ERROR: Database Engine Error
Sender Class: TGLPreviewBtn
Exception Class: EIBODBError.
IBO ErrorERRCODE=335544569 SQLCODE=-204
Error Message:
ISC ERROR CODE:335544569
ISC ERROR MESSAGE:
Dynamic SQL Error
SQL error code = -204
Procedure unknown
GET_SUB_CONTACTLIST
At line 3, column 60
This has been a recurring thing since I've been hired (I've been here for about 45 days), and we've reported this error to the company which hosts the billing system that we use to access the database. The company keeps saying that it's a network issue on our end, however I cannot see any indication of a connection drop on our end.
I have to reiterate that we have no back-end access to this database so I have no way of going to see what GET_SUB_CONTACTLIST even refers to.
Any help will be appreciated, I am just out of college and this is my first job in a position like this so I will use this as a great learning experience.
This cannot be a network error on your end. The error literally means that Firebird was asked to execute a stored procedure called GET_SUB_CONTACTLIST, and that stored procedure does not exist at that time.
So either someone (or something) is creating and dropping stored procedures on the fly, or part of the application is calling a stored procedure that simply does not exist.
As an aside: error 335544569 (aka isc_dsql_error) covers a broad range of error conditions with 'dynamic' SQL (in other words: most SQL related errors...), unfortunately a lot of client libraries do not communicate the more specific error code 335544581 (or isc_dsql_procedure_err).

Firebird select statement gives SQLSTATE = 42S02

I've made a very simple database and am trying
select * from klant;
I've verified the table exists, and last week was able to see data in it. Today however I keep getting
Statement failed, SQLSTATE = 42S02
Dynamic SQL Error
-SQL error code = -204
-Table unknown
-KLANT
-At line 1, column 15
The same select query in flameRobin gives the following error:
Error: *** IBPP::SQLException ***
Context: Database::Statistics
Message: isc_database_info failed
SQL Message : -902
can't format message 13:98 -- message file C:\WINDOWS\SYSTEM32\firebird.msg not found
Engine Code : 335544727
Engine Message :
Error writing data to the connection.
I have copied the firebird.msg to the system32 folder so it should be able to find it there.
Any pointers toward the solution would be greatly appreciated. Similar question all seem to point toward issues with transactions, I can't see that being the problem here.
Edit:
I'm using the included ISQL tool from firebird and start the session by connecting to the database that includes my table. Same for flamerobin, first connect to database, I can see the table that i want to select from but it gives this error.
Edit2:
Finally reinstalled Firebird making sure I gave it admin right, which I think it had before, but wasn't sure about. This seems to have fixed it.

ORA-12801: error signaled in parallel query server P004 and ORA-01555: snapshot too old

I am executing a insert into ... select ... from ... where ... SQL and got following error using Oracle:
java.sql.SQLException: ORA-12801: error signaled in parallel query server P004
ORA-01555: snapshot too old: rollback segment number 32 with name "_SYSSMU32_2039035886$" too small
I read the following doc: http://www.dba-oracle.com/t_ora_12801_parallel_query.htm and http://www.dba-oracle.com/t_ora_01555_snapshot_old.htm
Saying ORA-12801 is caused by no enough processors to support parallel query. ORA-01555 error relates to insufficient undo storage or a too small value for the undo_retention parameter.
But how can I check related parameters to avoid such issue recur?
ORA-12801 is a generic error message and we must check the second message on the error stack to find the real error. From the manual:
ORA-12801: error signaled in parallel query server string
Cause: A parallel query server reached an exception condition.
Action: Check the following error message for the cause, and consult your error manual for the appropriate action.
There are literally thousands of different reasons for an ORA-12801 error, and that error almost never has anything to do with not enough processors. This is an example of how the site you linked to often contains bad or outdated information. Maybe 17 processes was "a lot" 17 years ago but it's not today. Unfortunately, that site is often the first result from Google.
For troubleshooting your second error, ORA-01555, check the UNDO retention, which is the amount of time in seconds, like this:
select value from v$parameter where name = 'undo_retention'
The amount of space available for the UNDO tablespace is also relevant:
select round(sum(maxbytes)/1024/1024/1024) gb
from dba_data_files
where tablespace_name like '%UNDO%';
Once again, see the manual for more information on the parameter.