You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The param "dbport" cannot be resolved from CLI options or stage params. If you are using Serverless Framework Compose, make sure to run commands via Compose so that all parameters can be resolved
#44
I am trying to pass variables between stacks using Serverless Compose, but I get an error when using that variable to execute a sql migration using the serverless-sequelize-migrations plugin. I am not sure if this is an issue with the plugin, a limitation in Serverless or just me doing something wrong.
Cannot resolve serverless.yml: Variables resolution errored with:
- Cannot resolve variable at "provider.environment.DB_PORT": The param "dbport" cannot be resolved from CLI options or stage params. If you are using Serverless Framework Compose, make sure to run commands via C
ompose so that all parameters can be resolved
Error:
Error: Command failed: serverless migrations down
at checkExecSyncError (node:child_process:885:11)
at execSync (node:child_process:957:15)
at Scripts.execute (/Users/christoffer/Documents/code/konsult-gpt/node_modules/serverless-plugin-scripts/lib/index.js:113:35)
at Scripts.runHook (/Users/christoffer/Documents/code/konsult-gpt/node_modules/serverless-plugin-scripts/lib/index.js:108:12)
at PluginManager.runHooks (/Users/christoffer/Documents/code/konsult-gpt/node_modules/serverless/lib/classes/plugin-manager.js:530:15)
at runNextTicks (node:internal/process/task_queues:60:5)
at process.processImmediate (node:internal/timers:447:9)
at async PluginManager.invoke (/Users/christoffer/Documents/code/konsult-gpt/node_modules/serverless/lib/classes/plugin-manager.js:564:9)
at async PluginManager.run (/Users/christoffer/Documents/code/konsult-gpt/node_modules/serverless/lib/classes/plugin-manager.js:604:7)
at async Serverless.run (/Users/christoffer/Documents/code/konsult-gpt/node_modules/serverless/lib/serverless.js:179:5)
at async /Users/christoffer/Documents/code/konsult-gpt/node_modules/serverless/scripts/serverless.js:834:9
The variable is usable in the stack as I can see it in my environment when deploying a lambda. Is there something I am missing about how serverless handles its context or is this maybe a bug in the plugin?
Relevant snippets from my setup:
serverless_compose.yml:
services:
service:
path: service
migration:
path: migration
params:
dbport: ${service.port}
It seems like this could probably be solved by allowing us to call the script with parameters as those are resolved beforehand. Calling the script like so:
serverless migrations down --DB_PORT ${self:provider.environment.DB_PORT}
Gives the following error (to be expected really):
I am trying to pass variables between stacks using Serverless Compose, but I get an error when using that variable to execute a sql migration using the serverless-sequelize-migrations plugin. I am not sure if this is an issue with the plugin, a limitation in Serverless or just me doing something wrong.
The variable is usable in the stack as I can see it in my environment when deploying a lambda. Is there something I am missing about how serverless handles its context or is this maybe a bug in the plugin?
Relevant snippets from my setup:
serverless_compose.yml:
service/serverless.yml:
migration/serverless.yml:
The text was updated successfully, but these errors were encountered: