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

fix: Error Cannot read properties of undefined (reading 'sendTelemetry') #3734

Merged
merged 1 commit into from
Dec 21, 2024

Conversation

karlobencic
Copy link
Contributor

If the database closes the connection during initialization, the app server continues to work with uninitialized properties.

[server]: Error during Data Source initialization: Connection lost: The server closed the connection.
QueryFailedError: Connection lost: The server closed the connection.
[server]: Flowise Server is listening at :3000
...
[server]: Error: Cannot read properties of undefined (reading 'sendTelemetry')
TypeError: Cannot read properties of undefined (reading 'sendTelemetry')

https://github.com/FlowiseAI/Flowise/blob/main/packages/server/src/index.ts#L82

Current code only checks for nodesPool initialization but there are still actions that can fail after the nodesPool is initialized. This PR addresses this issue by checking if the telemetry is successfully initialized as the last action in the initDatabase method. If it's not then the server should fail and be restarted.

Copy link
Contributor

@HenryHengZJ HenryHengZJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @karlobencic !

@HenryHengZJ HenryHengZJ merged commit e8a33e4 into FlowiseAI:main Dec 21, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants