Ross Coundon
09/27/2021, 10:23 PMsst start
locally and specifying the same stage name that's in Seed it should allow me to ‘take over’ that application and route the API calls to my local code. Then, when I'm done, I could kick off the deploy in Seed to remove the debug stack.
However, after doing this, all requests immediately fail when running from the Seed deployed version with HTTP 500. I don't think it's even getting as far as hitting the integrated lambdas.
If I then run sst start
for that stage locally it works again.
I've also noticed that I have multiple lambdas by the same name in the account now, I'm wondering if this approach has led to things getting duplicated - haven't proven that yet, that's a job for tomorrow.
As I say, I need to do some more investigation in the morning but wanted to mention it in case there's something inherently wrong with what I'm trying to do.thdxr
09/27/2021, 10:28 PMRoss Coundon
09/28/2021, 7:16 AMRoss Coundon
09/28/2021, 7:17 AMRoss Coundon
09/28/2021, 7:20 AMRoss Coundon
09/28/2021, 10:50 AMTypeError: Cannot read property 'length' of undefined
at /tmp/seed/source/stacks/index.ts:82:19
at /tmp/seed/source/node_modules/@serverless-stack/resources/src/Stack.ts:31:35
at Array.map (<anonymous>)
at new Stack (/tmp/seed/source/node_modules/@serverless-stack/resources/src/Stack.ts:30:59)
at new OmwOfscBeStack (/tmp/seed/source/stacks/OmwOfscBeStack.ts:29:5)
I'm using the callback form of setDefaultFunctionProps and the SST code that's erroring is related to that:
this.defaultFunctionProps = root.defaultFunctionProps.map((dfp) =>
typeof dfp === "function" ? dfp(this) : dfp
);
i.e. I'm doing
app.setDefaultFunctionProps((stack) => {
// some checks that require VPN set up go first
// but I'm currently bypassing that for simplicity
// so literally just returning
return {
runtime: 'nodejs14.x',
}
}
Ross Coundon
09/28/2021, 10:55 AMapp.setDefaultFunctionProps(props);
makes that error go awayRoss Coundon
09/28/2021, 11:32 AMsst start
I lazily add some optional functions and routes to the Api construct.
The problem seems to be that when running locally that when I assign the name of the table to an env var like this it works:
DYNAMO_DB_OMW_TABLE_NAME: omwTable.tableName,
However, when I run it normally without the debug stack I get an error saying that the table name is not specified.
However, the truly bizarre thing is that, if I look at the console, the value for DYNAMO_DB_OMW_TABLE_NAME is set.
The other odd thing that's going on is that epsagon isn't tracing. Which implies that the env var for the Epsagon token is also missing. However, that also shows in the console.
Running out of ideas!Ross Coundon
09/28/2021, 11:51 AMRoss Coundon
09/28/2021, 12:04 PMError: There is already a Construct with name 'cust-sat-table' in OmwOfscBeStack [eon-test-omw-ofsc-be-OmwOfscBeStack-eon-test]
However, it's defined only oncethdxr
09/28/2021, 12:05 PMRoss Coundon
09/28/2021, 12:05 PMRoss Coundon
09/28/2021, 12:05 PMRoss Coundon
09/28/2021, 12:06 PMthdxr
09/28/2021, 12:06 PMRoss Coundon
09/28/2021, 12:08 PMRoss Coundon
09/28/2021, 12:09 PMsst deploy
from my own machine. That'd help to pinpoint if this is down to SeedRoss Coundon
09/28/2021, 12:22 PMthdxr
09/28/2021, 1:41 PMRoss Coundon
09/28/2021, 1:46 PMRoss Coundon
09/28/2021, 1:46 PMthdxr
09/28/2021, 2:15 PMsst build
work?Ross Coundon
09/28/2021, 2:16 PMthdxr
09/28/2021, 2:16 PMthdxr
09/28/2021, 2:17 PMRoss Coundon
09/28/2021, 2:17 PMRoss Coundon
09/28/2021, 2:29 PMthdxr
09/28/2021, 2:30 PMthis.myStaticFunction()
isn't that impossible?Ross Coundon
09/28/2021, 2:30 PMthdxr
09/28/2021, 2:31 PMClassName.staticFunction()
Ross Coundon
09/28/2021, 2:32 PMRoss Coundon
09/28/2021, 2:35 PMRoss Coundon
09/28/2021, 2:41 PMRoss Coundon
09/28/2021, 2:41 PMRoss Coundon
09/28/2021, 2:47 PMthdxr
09/28/2021, 2:58 PMthdxr
09/28/2021, 2:59 PMRoss Coundon
09/28/2021, 3:02 PM