snowflakedb / snowflake-connector-nodejs

NodeJS driver
Apache License 2.0
121 stars 129 forks source link

SNOW-1677142: Issue with uploading local file at in system to snowflake internal stage #916

Closed tanujvyas10 closed 3 weeks ago

tanujvyas10 commented 3 weeks ago

Please answer these questions before submitting your issue. In order to accurately debug the issue this information is required. Thanks!

  1. What version of NodeJS driver are you using? └── snowflake-sdk@1.13.1

  2. What operating system and processor architecture are you using? macos

  3. What version of NodeJS are you using? (node --version= v22.4.0 and npm --version = 10.8.1)

  4. What are the component versions in the environment (npm list)?

  5. ├── @aws-sdk/client-kafkaconnect@3.654.0 ├── @clickhouse/client@1.6.0 ├── @google-cloud/bigquery@7.9.0 ├── @google-cloud/storage@7.13.0 ├── @influxdata/influxdb-client-apis@1.35.0 ├── @influxdata/influxdb-client@1.35.0 ├── @kubernetes/client-node@0.20.0 ├── @rodrigogs/mysql-events@0.6.0 ├── @sentry/node@7.119.0 ├── aws-sdk@2.1691.0 ├── axios@1.7.7 ├── bull@4.16.3 ├── convict@6.2.4 ├── cors@2.8.5 ├── csvtojson@2.0.10 ├── detect-port@1.6.1 ├── dotenv@16.4.5 ├── express-session@1.18.0 ├── express-validator@7.2.0 ├── express@4.21.0 ├── fastest-validator@1.19.0 ├── glob@10.4.5 ├── google-auth-library@9.14.1 ├── googleapis@128.0.0 ├── http-errors@2.0.0 ├── ioredis@5.4.1 ├── jasypt@1.0.7 ├── jest@29.7.0 ├── jks-js@1.1.3 ├── json2yaml@1.1.0 ├── JSONStream@1.3.5 ├── jsonwebtoken@9.0.2 ├── jwks-rsa@3.1.0 ├── kafkajs-metrics-visualize@1.0.0 ├── kafkajs-metrics@1.0.0 ├── kafkajs@2.2.4 ├── lodash@4.17.21 ├── lz4@0.6.5 ├── moment-timezone@0.5.45 ├── moment@2.30.1 ├── mongodb@6.9.0 ├── mongoose@7.8.1 ├── mssql@11.0.1 ├── mysql2@3.11.3 ├── ndjson@2.0.0 ├── newrelic@11.23.2 ├── node-cron@3.0.3 ├── nodemon@3.1.6 ├── pg@8.13.0 ├── prettier@3.3.3 ├── readable-stream@4.5.2 ├── snowflake-sdk@1.13.1 ├── ssh2@1.16.0 ├── swagger-jsdoc@6.2.8 ├── through2@4.0.2 ├── uuid@9.0.1 └── winston@3.14.2

6.Server version:* E.g. 1.90.1 You may get the server version by running a query:

SELECT CURRENT_VERSION();
  1. What did you do?

Issue: I encountered an issue while trying to upload a file from my local storage to an internal stage using the following command:

bash

PUT file:///<path>/<filename>.json @MY_INTERNAL_STAGE

Here’s the error I received:

{
   source: 'random9999.json',
   target: 'random9999.json.gz',
   sourceSize: 39050,
   targetSize: 0,
   sourceCompression: null,
   targetCompression: 'GZIP',
   status: 'ERROR',
   message: "Error: Error: 3xxxxxxxxxxx1-compute@developer.gserviceaccount.com does not have storage.objects.get access to the Google Cloud Storage object. Permission 'storage.objects.get' denied on resource."
}

However, when I ran the following command (local computer):

env -i bash --noprofile --norc

...and ran my server inside it (or using Docker), then executed the PUT command again, the file successfully uploaded to the internal stage.

  1. What did you expect to see? Screenshot 2024-09-23 at 4 17 40 PM
sfc-gh-dszmolka commented 3 weeks ago

hi and thanks for raising this issue ! at first glance it looks similar to https://github.com/snowflakedb/snowflake-connector-nodejs/issues/705

can you please try using forceGCPUseDownscopedCredential: true in connection settings and see if it helps tacking this issue? Reference: https://docs.snowflake.com/en/release-notes/clients-drivers/nodejs-2024#version-1-10-0-february-27-2024