Comments (3)
hi and thank you for submitting this issue - thanks to all the details you provided, I reproduced the same problem.
However, I do not think it is anyhow related to the Snowflake Go driver; since the exact same behaviour reproduces with the Python driver as well:
import snowflake.connector
con = snowflake.connector.connect(
user='admin',
account='myaccount.eu-central-1',
password='password',
database='TEST_DB',
schema='PUBLIC',
session_parameters={ "SEARCH_PATH": "'$current'" }
)
print(con.cursor().execute("select current_user()").fetchall())
con.close()
crashes the exact same way, producing very similar output to that of gosnowflake
's:
ERRO[0085]log.go:352 gosnowflake.(*defaultLogger).Errorln Authentication FAILED
2024/01/22 04:55:44 failed to run a query. SELECT 1, err: 370001 (08004): Internal error: Processing aborted due to error 300002:1428825699; incident 4650476.
suggesting something goes wrong inside the Snowflake engine, rather than the driver.
I now passed the details found during the investigation on to the team responsible for the Snowflake engine to investigate further.
While it gets sorted, you can perhaps consider setting up a multi-statement query as a workaround and after authenticating without SEARCH_PATH
session parameter, fire it as the first query in the multi-statement, something like:
multi_statement_query := "ALTER SESSION SET SEARCH_PATH='$current'; SELECT 1;"
example program for multi-statement queries
tested it and specifying it inside the multi-statement query did not crash it.
Hope it helps you too. For this issue, I'm going to close it since it does not seem to be related to the gosnowflake
driver but rather the backend does not seem to support SEARCH_PATH
as part of the connection string.
from gosnowflake.
Thanks for the clarification on this @sfc-gh-dszmolka
Would you have any recommendations/work around on running ALTER SESSION every time a new connection is added to the connection pool? I'd prefer to set the search path only once after I run db.Open() instead of having to set it on every SQL query in my code.
from gosnowflake.
perhaps you could try using context, example from insertvariantobject.go from over the example programs here (many others use the same approach)
db, err := sql.Open("snowflake", dsn)
if err != nil {
log.Fatalf("failed to connect. %v, err: %v", dsn, err)
}
defer db.Close()
ctx := context.Background()
conn, err := db.Conn(ctx)
if err != nil {
log.Fatalf("Failed to acquire connection. err: %v", err)
}
defer conn.Close()
per sql.DB.Conn documentation, this way a pool is used and thus the same session for all the subsequent commands = same ALTER SESSION..
should affect all subsequent commands in the same session. (edit: this is not true , I need to correct myself, there is no guarantee always the same connection will be returned from the pool. )
Alternatively perhaps since the param seems to be account lineage (Can be set for Account ยป User ยป Session), if that makes sense to your use case, you can 'hardcode' it even for one or more users with
ALTER USER <username> SET SEARCH_PATH = '<value...>'
then it will be the default for the particular user, without needing to set it always.
from gosnowflake.
Related Issues (20)
- Using bool type parmeter failed with error code = 100132 in multi statements query HOT 3
- Array binding support for filtering parameter HOT 2
- SNOW-938672 Snyk: gosnowflake google.golang.org/grpc v1.49.0 | Snyk ID - SNYK-GOLANG-GOOGLEGOLANGORGGRPC-5953328 HOT 3
- Segfault from s3_storage_client.go:96 HOT 6
- WithMultiStatement - creates an extra process for all queries that doesn't resolve until all queries are resolved. Takes up extra space and blocks other requests. HOT 2
- SNOW-995607 Snyk: gosnowflake golang.org/x/crypto v0.15.0 | Snyk ID - SNYK-GOLANG-GOLANGORGXCRYPTOSSH-6130669 HOT 3
- SNOW-995714 SNOW-998050 Calling stored procedure returning a table in multi-statements query fail with code = 100132 HOT 2
- SNOW-996366 Snyk: gosnowflake github.com/dvsekhvalnov/jose2go 1.5.0 | Snyk ID - SNYK-GOLANG-GITHUBCOMDVSEKHVALNOVJOSE2GO-6137739 HOT 4
- Context not propagated to snowflakeFileTransferAgent on PUT command; cancellation is not supported HOT 3
- JWT token generation is generating an invalid JWT issuer using {account} value HOT 4
- GetArrowBatches panics when query returns 0 rows HOT 8
- SNOW-1017575 github.com/form3tech-oss/jwt-go is deprecated HOT 3
- No way to add a row with different typed columns through gosnowflake driver HOT 2
- SNOW-1020361 Unable to insert a UUID/byte array into an existing table HOT 7
- SNOW-1045439 Timestamp_ntz column values are formatted with UTC timezone HOT 3
- SNOW-1061246 "account" parameter is always required by `sf.DSN`? HOT 3
- Race in `easy_logging.go` introduced in v1.8.0 HOT 1
- Does setting CLIENT_SESSION_KEEP_ALIVE to true keep compute resources active and cost money? HOT 2
- SNOW-1230690 File Transfers to buckets in AWS US GOV and AWS China Partitions fail as they do not support Transfer Acceleration HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gosnowflake.