502, Websocket error?


After some fixes (described in the previous post “502 when GET internal/services/general/v1/server”), I could manage to launch Twake. I was able to create 2 accounts and 1 company. But, then, I can’t exchange messages. It seems that it is linked to a websocket error.
Here is the console log:
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

And 502 bad gateway errors with these requests:

Any help would be greatly appreciated!

It is possible that node isn’t started (but stil that’s strange). Try to do a fresh install with this changes:
You can try this changes: https://github.com/linagora/Twake/pull/1681/files

  1. Add the “- PUBSUB_URLS=amqp://guest:guest@rabbitmq:5672” line

  2. Use the 2021.Q2.505 version

The PR in the link will soon be merged for future on-premises testers. Next version coming on 22 of October will be compatible again with on-premise installation and you’ll be able to put back the “latest” tag and see the most recent features.

Merci Romaric for the answer but still I am not able to run Twake correctly:
Screenshot from 2021-10-11 17.57.23

I have a js error:
SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data main.61592a2b.chunk.js:1:847704

And 502 websocket errors:

docker-compose logs node gives me this output. Anyway, I don’t think that’s the problem.

node_1 | /usr/src/app/node_modules/pino/lib/levels.js:165
node_1 | throw Error(default level:${defaultLevel} must be included in custom levels)
node_1 | ^
node_1 |
node_1 | Error: default level:undefined must be included in custom levels
node_1 | at assertDefaultLevelFound (/usr/src/app/node_modules/pino/lib/levels.js:165:11)
node_1 | at Object.pino [as default] (/usr/src/app/node_modules/pino/pino.js:159:3)
node_1 | at Object. (/usr/src/app/dist/core/platform/framework/logger.js:10:32)
node_1 | at Module._compile (internal/modules/cjs/loader.js:999:30)
node_1 | at Object.Module._extensions…js (internal/modules/cjs/loader.js:1027:10)
node_1 | at Module.load (internal/modules/cjs/loader.js:863:32)
node_1 | at Function.Module._load (internal/modules/cjs/loader.js:708:14)
node_1 | at Module.require (internal/modules/cjs/loader.js:887:19)
node_1 | at require (internal/modules/cjs/helpers.js:74:18)
node_1 | at Object. (/usr/src/app/dist/core/platform/framework/api/component.js:7:18)
node_1 | npm ERR! code ELIFECYCLE
node_1 | npm ERR! errno 1
node_1 | npm ERR! @twake/twake-backend@1.0.0 serve: node --max-http-header-size=30000 dist/server.js
node_1 | npm ERR! Exit status 1
node_1 | npm ERR!
node_1 | npm ERR! Failed at the @twake/twake-backend@1.0.0 serve script.

I’ll give a try to the next version hoping that these problems will be solved…

Yes, problems are solved :grinning:

HI Mangeot & Romaric,

I was waiting for Twake to come up to a more mature version :slight_smile:

I’m actually running into the same issue as you @mangeot :

  1. I AM running 2021.Q2.505 version
  • Could you please tell me what you did to get it running @mangeot ?

Thanks a lot for your insight.


Ok, I’ve been able to get it working once.

Then as soon as I change ANYTHING in Parameters.php, I get the same issues with nothing appearing on the menu…

Even reverting BACK to original Parameters.php and upon restarting docker, and even rebooting my VM, I still get the same issue.

I’d be really gratefull if @romaric could give me some assistance here if possible? :slight_smile:

Thanks a lot!

Any chance you could look into this please?

Hello, sorry for this late answer, we are working very hard to get rid of Parameters.php and php in general. This will be the next on-premise-ready version of Twake, we have nobody able to help you on this specific version unfortunately, I will try to answer if I find time, sorry for this.

According to me it means the node container did not start or is not working well. Could you try to look at the node container docker logs ?
docker-compose logs -f --tail 100 node
Maybe there is an issue connecting to the database or something else ?
Also, node must absolutly be started after the database is ready and running, not before.