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

When using Odoo as metadata, after adding a new Edge, all edges stop displaying on the backend UI dashboard #2822

Closed
katsuya opened this issue Sep 30, 2024 · 4 comments

Comments

@katsuya
Copy link
Contributor

katsuya commented Sep 30, 2024

Description

Whenever a new Edge is added, the bug mentioned in the title always occurs. At this time, checking http://localhost:4200/overview shows that the getEdges API outputs the error 'Unable to find edge with id [xxx]'. However, restarting the backend resolves the issue, and all edges, including the newly added one, are displayed on the dashboard.

Here is the bug details:

  • When initializing the connection with PostgreSQL, all edges are loaded into the cache.
    InitializeEdgesWorker.java#L39-L52
  • The getEdges API calls the getPageDevice method:
    MetadataOdoo.java#L578
  • Next, getPageDevice calls convertToEdgeMetadata for each edge:
    MetadataOdoo.java#L596-L603
  • Since the newly added Edge is not in the cache, the error throw new OpenemsException("Unable to find edge with id [" + edgeId + "]") occurs.
  • The cache is only updated during the initialization of the connection with PostgreSQL, so a restart is required after adding a new edge.

Screenshots

CleanShot 2024-09-30 at 17 53 04@2x

Operating System

macOS

How to reproduce the Error?

Steps to Reproduce:

  • Use Odoo as metadata.
  • While the backend is running, add a new Edge.
  • Launch the backend UI and navigate to /overview.
  • None of the edges registered in Odoo are displayed.
@katsuya katsuya changed the title When using Odoo as metadata, after adding a new Edge, all edges stop displaying on the backend UI dashboard. When using Odoo as metadata, after adding a new Edge, all edges stop displaying on the backend UI dashboard Sep 30, 2024
@Sn0w3y
Copy link
Contributor

Sn0w3y commented Sep 30, 2024

This is not an actual Issue but more of a "Feature" as it is not intended to add more edges in Production without Restarting. If you want you could see in my PR where i tried to fix this "Issue" !

#2505

Greetings

@katsuya
Copy link
Contributor Author

katsuya commented Oct 1, 2024

Thank you for your response. I understand that this should be addressed as a feature rather than a bug. I would like to implement this as a feature, so it would be helpful if you could let me know why #2505 was not merged and what the issues were.

Thank you!

@Sn0w3y
Copy link
Contributor

Sn0w3y commented Oct 1, 2024

Hi, i re-opened the PR so we can work on it maybe:

#2827

Please close the Issue so we can see that is is already WIP

@katsuya katsuya closed this as completed Oct 1, 2024
@Sn0w3y
Copy link
Contributor

Sn0w3y commented Oct 3, 2024

@katsuya could you maybe check my Code in the PR and confirm it working ?

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

No branches or pull requests

2 participants