seems like we're maybe swallowing some error but d...
# sst
t
seems like we're maybe swallowing some error but do you see that
BlockPublicAccesError
in there
o
Yeah seems weird to by dumping the file contents
I think this broke with an SST update we did a while back - does CDK need different permissions now?
I tried upgrading to the latest SST (0.69.3), running into (probably) a different issue:
Copy code
TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received undefined
    at new NodeError (internal/errors.js:322:7)
    at validateString (internal/validators.js:124:11)
    at Module.require (internal/modules/cjs/loader.js:967:3)
    at require (internal/modules/cjs/helpers.js:93:18)
    at Object.<anonymous> (/Users/omi/workspaces/sst-services/node_modules/@serverless-stack/cli/assets/debug-stack/bin/index.js:19:17)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) {
  code: 'ERR_INVALID_ARG_TYPE'
}
Seems to stem from this line:
Copy code
// sst-services/node_modules/@serverless-stack/cli/assets/debug-stack/bin/index.js

const name = process.argv[2];
const stage = process.argv[3];
const region = process.argv[4];
const appBuildLibPath = process.argv[5];

// Load environment variables from dotenv
Util.Environment.load({
  searchPaths: [`.env.${stage}.local`, `.env.${stage}`],
});

// Validate the `debugStack` option in user SST app's index
const handler = require(appBuildLibPath);
I logged out `process.argv`:
Copy code
process.argv [
  '/Users/omi/.nvm/versions/node/v14.18.2/bin/node',
  '/Users/omi/workspaces/sst-services/node_modules/@serverless-stack/cli/assets/debug-stack/bin/index.js',
  'fragment-services',
  'omi',
  '/Users/omi/workspaces/sst-services/.build/lib'
]
Looks like region is missing?
I ran it with --region manually, that seemed to work for a while, but then it just looped with:
Copy code
Stacks: Synthesizing changes...
Stacks: Synthesizing changes...
Stacks: Synthesizing changes...
Stacks: Synthesizing changes...
Stacks: Synthesizing changes...
Stacks: Synthesizing changes...
Stacks: Synthesizing changes...
Stacks: Synthesizing changes...
Stacks: Synthesizing changes...
Stacks: Synthesizing changes...
Stacks: Synthesizing changes...
Stacks: Building changes...
Stacks: Synthesizing changes...
Stacks: Synthesizing changes...
Stacks: Synthesizing changes...
Stacks: Synthesizing changes...
Stacks: Synthesizing changes...
Stacks: Synthesizing changes...
Stacks: Synthesizing changes...
Stacks: Synthesizing changes...
Stacks: Synthesizing changes...
Stacks: Synthesizing changes...
Stacks: Synthesizing changes...
Stacks: Synthesizing changes...
Stacks: Synthesizing changes...
First time it looped for 30 mins (left it over lunch), then 10 minutes - both times had to exit with ctrl. + c)
@thdxr We finally figured out this issue, tracked it down to a bug in this line: https://github.com/serverless-stack/serverless-stack/blob/master/packages/core/src/cli/StacksBuilder.ts#L206 Passing in an ignored file list fixed it:
Copy code
chokidar_1.default
        .watch(path_1.default.dirname(config.main) + "/**/*", {
        persistent: true,
        ignoreInitial: true,
        followSymlinks: false,
        ignored: ["**/node_modules/**", "**/.build/**", "**/.sst/**"]
    })
(we dirty patched the compiled version to test it
Should I open a PR with this change?
t
wow nice - yes please!
o
Opened the PR, can we backport it to 0.69? https://github.com/serverless-stack/serverless-stack/pull/1596
Also do you know how to solve the region issue (in the message above)? Not sure why region is being omitted
t
yeah we have another branch to do 0.x releases
not sure about region I'll take a look
f
Hey @Omi Chowdhury, the region issue is fixed in v0.69.5.
o
This fix didn’t work for me:
Copy code
➜  sst-services git:(dev) ✗ yarn sst --version
yarn run v1.22.10
$ /Users/omi/workspaces/node_modules/.bin/sst --version
SST: 0.69.5
CDK: 2.15.0
✨  Done in 1.27s.

➜  sst-services git:(dev) ✗ yarn sst start
yarn run v1.22.10
$ /Users/omi/workspaces/node_modules/.bin/sst start
Using stage: omi
Preparing your SST app

=======================
 Deploying debug stack
=======================

process.argv [
  '/Users/omi/.nvm/versions/node/v14.17.0/bin/node',
  '/Users/omi/workspaces/sst-services/node_modules/@serverless-stack/cli/assets/debug-stack/bin/index.js',
  'fragment-services',
  'omi',
  '/Users/omi/workspaces/sst-services/.build/lib'
]
internal/validators.js:124
    throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "id" argument must be of type string. Received undefined
    at validateString (internal/validators.js:124:11)
    at Module.require (internal/modules/cjs/loader.js:950:3)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/Users/omi/workspaces/sst-services/node_modules/@serverless-stack/cli/assets/debug-stack/bin/index.js:18:17)
    at Module._compile (internal/modules/cjs/loader.js:1068:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
    at Module.load (internal/modules/cjs/loader.js:933:32)
    at Function.Module._load (internal/modules/cjs/loader.js:774:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  code: 'ERR_INVALID_ARG_TYPE'
}
I logged out
process.argv
- same as before Works fine with --region flag