Wappler Version: 6.4.1 Beta
Operating System: Windows 11
Server Model: Node
Database Type: Postgres
Hosting Type: Docker
Expected behavior
When deploying to remote server on DO the application should work.
Actual behavior
I’m receiving the following error.
server-connect:server Got error? SyntaxError: app/modules/connections/db.json: Unexpected end of JSON input
server-connect:server at JSON.parse (<anonymous>)
server-connect:server at Object.readFileSync (/opt/node_app/node_modules/jsonfile/index.js:52:17)
server-connect:server at App.getDbConnection (/opt/node_app/lib/core/app.js:425:29)
server-connect:server at new DatabaseProvider (/opt/node_app/lib/auth/database.js:9:23)
server-connect:server at App.setAuthProvider (/opt/node_app/lib/core/app.js:186:26)
server-connect:server at App.getAuthProvider (/opt/node_app/lib/core/app.js:203:31)
server-connect:server at App.identify (/opt/node_app/lib/modules/auth.js:10:37)
server-connect:server at App._exec (/opt/node_app/lib/core/app.js:611:57)
server-connect:server at App.exec (/opt/node_app/lib/core/app.js:547:20)
server-connect:server at App.exec (/opt/node_app/lib/core/app.js:542:25) +10s
server-connect:router Serving templateView / +10s
How to reproduce
I’m not sure. This has happened a couple of times. If I review what changed in the connections/db.json I see this.
It seems like it’s mixing local target options (i.e. actionFilePath, servertype, filename) with the remote target details.
If I change from Beta channel to Stable channel and then publish to Digital Ocean again, the error is resolved, so I’m guessing it has something to do with Beta channel or switching between targets.
If I compare changes to app/modules/connections/db.json
after switching from Beta to Stable I notice that the previous file was the local Development target connection and the new file has the remote target connection. Not sure why this is switched from local to remote.
If I then switch back to Beta channel and publish again to the remote target, everything still works, so I’m not sure what the root cause is. Maybe something to do with switching between targets and publishing?