GithubHelp home page GithubHelp logo

starschema / starsnow_request Goto Github PK

View Code? Open in Web Editor NEW
25.0 25.0 8.0 167 KB

StarSnow: HTTP Client for Snowflake database (HTTP get/post from SQL)

License: BSD 3-Clause "New" or "Revised" License

JavaScript 100.00%

starsnow_request's People

Contributors

tfoldi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

starsnow_request's Issues

iam:CreateRole fails with an explicit deny

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:

  • IAM
  • S3
  • CloudFormation
  • APIGateway

BTW, this is an excellent post. Really enjoyed it.

"Error: Cannot find module 'lodash/core'\nRequire stack:\n- /var/task/handler.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js"

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"
    ]
}

Obsolete API Warnings

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.

Error: Unable to connect to Snowflake

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.