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
Hi. I'm trying to set up a trial/POC powersync implementation in AWS ECS and I am having trouble getting a powersync.yaml file passing to the task with substitutions for other environment variables. if I use the example straight from the website (https://github.com/powersync-ja/self-host-demo/blob/main/config/powersync.yaml) then powrsync complains with the following error:
{"level":"error","message":"Fatal error Could not collect config using Base64 method. Caught exception: Error: Could not parse PowerSync config file content as JSON or YAML: SyntaxError: Unexpected token '#', \"# yaml-lan\"... is not valid JSON","stack":"Error: Could not collect config using Base64 method. Caught exception: Error: Could not parse PowerSync config file content as JSON or YAML: SyntaxError: Unexpected token '#', \"# yaml-lan\"... is not valid JSON\n at CompoundConfigCollector.collectBaseConfig (file:///app/packages/service-core/dist/util/config/compound-config-collector.js:136:23)\n at async CompoundConfigCollector.collectConfig (file:///app/packages/service-core/dist/util/config/compound-config-collector.js:28:28)\n at async startUnifiedRunner (file:///app/service/lib/runners/unified-runner.js:11:20)\n at async Command.<anonymous> (file:///app/packages/service-core/dist/entry/commands/start-action.js:12:9)\n at async Command.parseAsync (/app/node_modules/.pnpm/[email protected]/node_modules/commander/lib/command.js:1092:5)\n at async runProgram (file:///app/packages/service-core/dist/entry/cli-entry.js:31:17)","timestamp":"2025-04-08T08:55:47.137Z"}
If I remove all of the !env entries in the config file then it appears to parse correctly but I obviously have an incomplete configuration. I have also tried using {envvar name} as placeholders (e.g. url: {PS_DATA_SOURCE_URL} and this also parses but fails with the following error message:
{"level":"error","message":"Fatal error Failed to validate Module Postgres configuration: /hostname: type must be string, /port: type must be number, /port: type must be string, /port: anyOf must match a schema in anyOf","stack":"Error: Failed to validate Module Postgres configuration: /hostname: type must be string, /port: type must be number, /port: type must be string, /port: anyOf must match a schema in anyOf\n at PostgresModule.validateConfig (file:///app/packages/service-core/dist/replication/ReplicationModule.js:59:19)\n at PostgresModule.decodeConfig (file:///app/packages/service-core/dist/replication/ReplicationModule.js:45:14)\n at PostgresModule.initialize (file:///app/packages/service-core/dist/replication/ReplicationModule.js:40:14)\n at PostgresModule.initialize (file:///app/modules/module-postgres/dist/module/PostgresModule.js:22:21)\n at ModuleManager.initialize (file:///app/packages/service-core/dist/modules/ModuleManager.js:20:26)\n at startUnifiedRunner (file:///app/service/lib/runners/unified-runner.js:20:25)\n at async Command.<anonymous> (file:///app/packages/service-core/dist/entry/commands/start-action.js:12:9)\n at async Command.parseAsync (/app/node_modules/.pnpm/[email protected]/node_modules/commander/lib/command.js:1092:5)\n at async runProgram (file:///app/packages/service-core/dist/entry/cli-entry.js:31:17)","timestamp":"2025-04-08T09:19:13.161Z"}
Am I doing something fundamentally wrong? Do substitutions not work, as suggested in the comments within the sample config file? Do I need to pre-build a config file pulling in values from AWS secrets where appropriate before passing to the ECS Task as a base 64 encoded config?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi. I'm trying to set up a trial/POC powersync implementation in AWS ECS and I am having trouble getting a powersync.yaml file passing to the task with substitutions for other environment variables. if I use the example straight from the website (https://github.com/powersync-ja/self-host-demo/blob/main/config/powersync.yaml) then powrsync complains with the following error:
{"level":"error","message":"Fatal error Could not collect config using Base64 method. Caught exception: Error: Could not parse PowerSync config file content as JSON or YAML: SyntaxError: Unexpected token '#', \"# yaml-lan\"... is not valid JSON","stack":"Error: Could not collect config using Base64 method. Caught exception: Error: Could not parse PowerSync config file content as JSON or YAML: SyntaxError: Unexpected token '#', \"# yaml-lan\"... is not valid JSON\n at CompoundConfigCollector.collectBaseConfig (file:///app/packages/service-core/dist/util/config/compound-config-collector.js:136:23)\n at async CompoundConfigCollector.collectConfig (file:///app/packages/service-core/dist/util/config/compound-config-collector.js:28:28)\n at async startUnifiedRunner (file:///app/service/lib/runners/unified-runner.js:11:20)\n at async Command.<anonymous> (file:///app/packages/service-core/dist/entry/commands/start-action.js:12:9)\n at async Command.parseAsync (/app/node_modules/.pnpm/[email protected]/node_modules/commander/lib/command.js:1092:5)\n at async runProgram (file:///app/packages/service-core/dist/entry/cli-entry.js:31:17)","timestamp":"2025-04-08T08:55:47.137Z"}
If I remove all of the !env entries in the config file then it appears to parse correctly but I obviously have an incomplete configuration. I have also tried using {envvar name} as placeholders (e.g. url: {PS_DATA_SOURCE_URL} and this also parses but fails with the following error message:
{"level":"error","message":"Fatal error Failed to validate Module Postgres configuration: /hostname: type must be string, /port: type must be number, /port: type must be string, /port: anyOf must match a schema in anyOf","stack":"Error: Failed to validate Module Postgres configuration: /hostname: type must be string, /port: type must be number, /port: type must be string, /port: anyOf must match a schema in anyOf\n at PostgresModule.validateConfig (file:///app/packages/service-core/dist/replication/ReplicationModule.js:59:19)\n at PostgresModule.decodeConfig (file:///app/packages/service-core/dist/replication/ReplicationModule.js:45:14)\n at PostgresModule.initialize (file:///app/packages/service-core/dist/replication/ReplicationModule.js:40:14)\n at PostgresModule.initialize (file:///app/modules/module-postgres/dist/module/PostgresModule.js:22:21)\n at ModuleManager.initialize (file:///app/packages/service-core/dist/modules/ModuleManager.js:20:26)\n at startUnifiedRunner (file:///app/service/lib/runners/unified-runner.js:20:25)\n at async Command.<anonymous> (file:///app/packages/service-core/dist/entry/commands/start-action.js:12:9)\n at async Command.parseAsync (/app/node_modules/.pnpm/[email protected]/node_modules/commander/lib/command.js:1092:5)\n at async runProgram (file:///app/packages/service-core/dist/entry/cli-entry.js:31:17)","timestamp":"2025-04-08T09:19:13.161Z"}
Am I doing something fundamentally wrong? Do substitutions not work, as suggested in the comments within the sample config file? Do I need to pre-build a config file pulling in values from AWS secrets where appropriate before passing to the ECS Task as a base 64 encoded config?
Any help would be much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions