Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Module registration failed Error: Call timed out #3258

Open
2 tasks done
semenovnick opened this issue Feb 6, 2025 · 3 comments
Open
2 tasks done

[BUG] Module registration failed Error: Call timed out #3258

semenovnick opened this issue Feb 6, 2025 · 3 comments
Labels
BUG Something isn't working
Milestone

Comments

@semenovnick
Copy link

semenovnick commented Feb 6, 2025

Is this a bug in companion itself or a module?

  • I believe this to be a bug in companion

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

The situation is quite similar to #2890. But in my case It began to manifest itself unpredictably on remote PC. I started trying to repeat it on my local PC.
After starting of connection/module, when on some reason process of connection/module is ended/corrupted (I made it from task manager). Companion runs in longtime loop of respawning the process with Module registration failed Error: Call timed out error, but connection status remains Connected for long period of time and after that ended with Unknown Stopped. I investigated the code and try to reproduce this error another way, it can be achieved only when forked process emmits exit. Seems like this listener do not hear 'exit' event

child.monitor.on('exit', forceRestart)

And then Respawn forks new process, start runEntrypoint function of module and not recieving from companion registration approvemet, companion remains sending variablesChanged message instead of register...

Steps To Reproduce

  1. Start any connection/module
  2. End task via Task Manager or other meth

here is report from logs

report_companion.zip

Expected Behavior

After corrupting of process force restarting of connection/ or correct changing of status for manual restart by trigger / or correct communication with new respawn process.

Environment (please complete the following information)

- OS: Windoiws 10
- Browser: any
- Companion Version: catched in 3.4.3 and 3.5.1 also

Additional context

Thank you in advance

@semenovnick semenovnick added the BUG Something isn't working label Feb 6, 2025
@semenovnick
Copy link
Author

semenovnick commented Feb 7, 2025

After initialization listener is removed for exit event in

child.monitor.off('exit', forceRestart)

And that ilstener
child.monitor.on('exit', forceRestart)

don't hear exit event... And then after unhandled error or sudden termination connection goes into that registration loop...

@Julusian
Copy link
Member

Julusian commented Feb 7, 2025

That 'exit' handler should be fine to remove, It is still being handled inside 'respawn' with a restart being performed automatically.

The boundary of who is responsible for what around this restarting is a bit blurred, that respawn file was originally a library from npm. but the library looks abandoned and we needed to make some fixes to it, so it got adopted.
But this means that the logic we added on top of it to track restarts and some custom behaviour is not very clear/clean anymore.

@semenovnick
Copy link
Author

Yes respawn restarts process successfully, but companion doesn't want to accept the new respawned process with new PID as e replacement of old crashed process and then when initialization starts and after:
https://github.com/bitfocus/companion-module-base/blob/58d91aaaf68ac3b3c654f9c605ffbcda61e2de3d/src/entrypoint.ts#L142
that Promise rejecting and new process is exit with code 11 than respawn restart process etc etc...
maybe Host after recieving exit Event should check and re-register new respawned process...

@Julusian Julusian added this to the v3.5 milestone Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BUG Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants