Blake E
09/30/2021, 4:12 PMClayton
09/30/2021, 4:42 PMErik Robertson
09/30/2021, 4:45 PM021-09-30T15:29:23.784Z a0688053-70ec-41c5-a480-13b3218dad0a ERROR Invoke Error
{ "errorType": "Error", "errorMessage": "ENOENT: no such file or directory, open '/var/task/src/schema.prisma'", "code": "ENOENT", "errno": -2, "syscall": "open", "path": "/var/task/src/schema.prisma", "clientVersion": "3.1.1", "stack": [ "Error: ENOENT: no such file or directory, open '/var/task/src/schema.prisma'", " at Object.openSync (fs.js:462:3)", " at Object.readFileSync (fs.js:364:35)", " at new LibraryEngine (/var/task/src/list.js:28474:46)", " at PrismaClient2.getEngine (/var/task/src/list.js:40879:20)", " at new PrismaClient (/var/task/src/list.js:40848:33)", " at Function.getClient (/var/task/src/list.js:41844:12)", " at Runtime.main [as handler] (/var/task/src/list.js:41853:17)", " at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)" ] }
Since then I've read here that Prisma needs a Lambda layer for it to work properly. So I'm assuming that could be causing that error. But even looking at various snippets mentioned on this Slack I haven't managed to get the layer to build (getting some error 'execSync' is not defined, etc...). Is there a working sample or step by step guide I could look at ?Clayton
09/30/2021, 7:47 PMBlake E
09/30/2021, 8:47 PMpnpm
)Jack Fraser
09/30/2021, 10:11 PMClayton
10/01/2021, 3:11 PMCREATE_FAILED | AWS::ApiGatewayV2::Stage | ApiStage4697DF29 CloudWatch Logs role ARN must be set in account settings to enable logging (Service: AmazonApiGatewayV2; Status Code: 400; Error Code: BadRequestException; Request ID: d4c744ab-4f22-41fc-91dc-f9e4101fa39c; Proxy: null)
I can resolve this if I add accessLog: false
to the WebSocket construct, but am wondering -
• what’s the consequence of disabling these logs?
• is this just a mismatch between the IAM user policies SST has you create initially and what this construct expects/needs by default?Patrick J
10/01/2021, 4:20 PMcolin
10/01/2021, 5:13 PMApolloApi
to allow requests from multiple user pool clients?, we have one setup with the property defaultAuthorizer
(client facing apps) but I’m wondering if theres a way to allow for another client to get authorized in our case an admin apiPatrick J
10/01/2021, 5:57 PMAdrián Mouly
10/02/2021, 9:41 PMSST: 0.44.0
CDK: 1.124.0
Using stage: dev
Preparing your SST app
Detected tsconfig.json
Transpiling source
Linting source
Error: Cannot find module 'eslint'
Require stack:
- /Users/xxx/Projects/xxx/xxx-serverless/.build/eslint.js
Garret Harp
10/03/2021, 6:22 PM.env.local
but it says credentials missing whenever I start. Possibly a "profile" file in .sst
like you do with stage if the default credentials are empty?Abdul Taleb
10/04/2021, 3:30 AMApolloApi
construct to support the default healthcheck endpoint? https://www.apollographql.com/docs/apollo-server/monitoring/health-checks/. If there is, will it have the option to bypass authentication or customize authentication?Luke Wyman
10/04/2021, 3:46 AMzip -r ../../../../src/my-deployment-package.zip
from inside my lib/python3.8/site-packages
in my virtual environment (does the same thing as requirements.txt)
• then ran over to the handlers
directory and did a zip -g getter.py
to add my Lambda handler
• then did a python3 -m build
inside libs
to build my wheel file, then a wheel unpack [package name]
inside dist
(created by the build
), cd'd into that directory and did another zip -r my-deployment-package.zip .
to add the decompressed wheel contents (a wheel behaves just like a zip) to the deployment package.
• deployed the zip, and it worked with package names like rest_helper.rest_helper
.
What this could look like as an sst implementation (maybe a construct kind of thing like script, or better yet, a property of defaultFunctionProps
like srcPath
is currently for Python projects? ) The big deal here is getting custom libs
packages into the docker container at image build time:
• specify a libs
folder in your sst/cdk code in the construct (there could be multiple libs
-style folders, depending on monorepo size and complexity)
• either the developer does there own python3 -m build
to make a package manually (although you'd have to remember to do this before each npx sst deploy
if you changed your lib code). Or, what I'm more inclined to do, is have sst do the build each time. The libs
folder supplied would have to have a setup.cfg
and pyproject.toml
for this to work (whether manual or automated).
• then, sst would "remember" and copy any wheel(s) to the docker container and install it (probably after doing the standard requirements.txt
install):
◦ COPY dist/[wheel package name].whl .
◦ RUN pip3 install --no-index --find-links=./ [wheel package name].whl --target "${LAMBDA_TASK_ROOT}"
• it would be up to the developer to run a pip install -e .
inside the libs
folder so that the tests can see the packages under test using the virtual environment. pip install -e .
installs a virtual link to the libs
folder so that the lambdas can see the packages in the IDE, and so that pytest can see the same packages at test time. Any code changes are detected without any rebuilds or reinstalls.Ross Coundon
10/04/2021, 11:38 AMapp.setDefaultFunctionProps
in the context of setting VPC settings and security groups.
The securityGroups property is readonly on sst.FunctionProps so I was getting around this by defining my own type where it was writeable. From memory I think you were going to have a look at why it was readonly in the base CDK class to determine if this was safe to do. Did I remember that right? If so, did you get a chance to look into it?Tyler Flint
10/04/2021, 3:35 PMTyler Flint
10/04/2021, 3:54 PMsource-map-support
isn’t working either. I’m wondering if that’s because it separates the sourcemap from the code during build, instead of inlining it?Tyler Flint
10/04/2021, 5:32 PMError: Cannot find the esbuild config file at "/Users/tylerflint/Code/tylerflint/serverless-app-template/Users/tylerflint/Code/tylerflint/serverless-app-template/config/esbuild.js"
Sam Hulick
10/05/2021, 1:05 AMDavid Martin
10/05/2021, 4:03 AMMichael Orcutt
10/05/2021, 5:54 PMTyler Flint
10/05/2021, 8:54 PMRoss Coundon
10/06/2021, 9:55 PMAurelien Negrier
10/07/2021, 10:11 AMschema.graphql
file is modified ?
Actually when I change my schema.graphql
I have to stop sst localy and restart sst start
commandMike McCall
10/07/2021, 2:18 PMRoss Coundon
10/07/2021, 7:57 PMconst epsagon = LayerVersion.fromLayerVersionArn(this, 'EpsagonLayer', process.env.EPSAGON_LAYER_ARN);
this.addDefaultFunctionLayers([epsagon]);
this.addDefaultFunctionEnv({
EPSAGON_TOKEN: process.env.EPSAGON_TOKEN,
EPSAGON_APP_NAME: process.env.EPSAGON_APP_NAME,
NODE_OPTIONS: '-r epsagon-frameworks',
});
I can see that all the necessary env vars are getting set. However, and everything deploys okay with sst start
but when executing a function it fails and I can see a log in Cloudwatch that says:
internal/modules/cjs/loader.js:892
throw err;
^
Error: Cannot find module 'epsagon-frameworks'
Require stack:
- internal/preload
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
at Function.Module._load (internal/modules/cjs/loader.js:745:27)
at Module.require (internal/modules/cjs/loader.js:961:19)
at Module._preloadModules (internal/modules/cjs/loader.js:1231:12)
at loadPreloadModules (internal/bootstrap/pre_execution.js:468:5)
at prepareMainThreadExecution (internal/bootstrap/pre_execution.js:71:3)
at internal/main/run_main_module.js:7:1 {
code: 'MODULE_NOT_FOUND',
requireStack: [ 'internal/preload' ]
}
Lukasz K
10/08/2021, 10:27 AMRoss Coundon
10/08/2021, 10:41 AMsst start
session with the app I'm migrating to SST.
When calling a function via API Gateway or via a Cognito hook, it returns a 500 Internal Server Error and I see this in logs (apologies for screenshot, it's spread over many lines so difficult to copy/paste). The lambdas aren't in a VPC. Any thoughts on what could be going on?Adrián Mouly
10/08/2021, 5:04 PMBlake E
10/08/2021, 5:10 PM