starschema / starsnow_request Goto Github PK
View Code? Open in Web Editor NEWStarSnow: HTTP Client for Snowflake database (HTTP get/post from SQL)
License: BSD 3-Clause "New" or "Revised" License
StarSnow: HTTP Client for Snowflake database (HTTP get/post from SQL)
License: BSD 3-Clause "New" or "Revised" License
When you deploy the project into an environment that uses AWS permissions boundaries (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) it fails with a role creation error. In my case, Roles could only be created with permissions boundaries applied. Since permissions boundaries are specific to the customer environment, I am not sure if this can be fixed in a generic sense. In my case I was able to fix the problem by setting the rolePermissionsBoundary attribute for the provider in the serverless yaml configuration file:
provider:
...
RolePermissionsBoundary: ....
Maybe it would be a good idea just to mention this in the documentation.
Another suggestion for a documentation enhancement is to mention the AWS permissions needed for this project:
BTW, this is an excellent post. Really enjoyed it.
This is the error I get when calling the function inside snowflake:
Request failed for external function STARSNOW_REQUEST_GET with remote service error: 502 '{"message": "Internal server error"}'; requests batch-id: 01a06e8d-0500-ddbd-000c-34030134c776:0:0; request batch size: 1 rows; request retries: 9; response time (last retry): 266.04ms
On the AWS logs, this is what I see.
2021-11-21T05:07:07.762Z undefined ERROR Uncaught Exception {
"errorType": "Runtime.ImportModuleError",
"errorMessage": "Error: Cannot find module 'lodash/core'\nRequire stack:\n- /var/task/handler.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js",
"stack": [
"Runtime.ImportModuleError: Error: Cannot find module 'lodash/core'",
"Require stack:",
"- /var/task/handler.js",
"- /var/runtime/UserFunction.js",
"- /var/runtime/index.js",
" at _loadUserApp (/var/runtime/UserFunction.js:100:13)",
" at Object.module.exports.load (/var/runtime/UserFunction.js:140:17)",
" at Object.<anonymous> (/var/runtime/index.js:43:30)",
" at Module._compile (internal/modules/cjs/loader.js:999:30)",
" at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)",
" at Module.load (internal/modules/cjs/loader.js:863:32)",
" at Function.Module._load (internal/modules/cjs/loader.js:708:14)",
" at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)",
" at internal/main/run_main_module.js:17:47"
]
}
npm install -g [email protected]
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
npm WARN deprecated [email protected]: Please downgrade to v7.1.5 if you need IE/ActiveXObject support OR upgrade to v8.0.0 as we no longer support IE and published an incorrect patch version (see ladjs/superagent#1731)
npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
Hi,
I'm looking at you excellent blog post and trying to get the demo working, however I'm getting the following error:
Error: Unable to connect to Snowflake: Request to Snowflake failed.
at /Users/cbourne/development/starsnow_request/node_modules/serverless-snowflake-external-function-plugin/lib/snowflake.js:165:23
at Object.callback (/Users/cbourne/development/starsnow_request/node_modules/snowflake-sdk/lib/connection/connection.js:121:13)
at Timeout.requestCallback (/Users/cbourne/development/starsnow_request/node_modules/snowflake-sdk/lib/services/sf.js:1133:23)
at Object.callback (/Users/cbourne/development/starsnow_request/node_modules/snowflake-sdk/lib/services/sf.js:639:37)
at Request.<anonymous> (/Users/cbourne/development/starsnow_request/node_modules/snowflake-sdk/lib/http/base.js:107:19)
at Request._callback (/Users/cbourne/development/starsnow_request/node_modules/lodash/lodash.js:10076:25)
at Request.requestRetryReply [as reply] (/Users/cbourne/development/starsnow_request/node_modules/requestretry/index.js:115:19)
at Request.<anonymous> (/Users/cbourne/development/starsnow_request/node_modules/requestretry/index.js:156:10)
at processTicksAndRejections (node:internal/process/task_queues:93:5)
Could you clarify exactly what these environment variables are:
set -x SNOWFLAKE_ACCOUNT (I set this to my snowflake organisation )
set -x SNOWFLAKE_USERNAME (I set this to my snowflake username)
set -x SNOWFLAKE_DATABASE (I set this to a simple test database)
set -x SNOWFLAKE_PASSWORD (I set this to my snowflake password)
set -x SNOWFLAKE_ROLE SYSADMIN
set -x SNOWFLAKE_SCHEMA TEST
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.