Skip to content

[#9530] Fix serialized metadata loading when optional plugins are unavailable - #9525

Open
rmannibucau wants to merge 1 commit into
apache:mainfrom
rmannibucau:fix/serialized-metadata-missing-plugins
Open

rmannibucau wants to merge 1 commit into
apache:mainfrom
rmannibucau:fix/serialized-metadata-missing-plugins

Conversation

@rmannibucau

@rmannibucau rmannibucau commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Issue

Saved execution metadata is a JSON object keyed by metadata type. SerializableMetadataProvider.toJson() writes an array for every registered type, even when no objects of that type exist. An execution snapshot can therefore contain entries such as "salesforceconnection": [] or "neo4j-connection": [] without the executed pipeline using either connection type.

When the snapshot is read in an installation where one of those optional metadata plugins is unavailable, the reader resolves the plugin before inspecting the array. This produces The metadata plugin for key ... could not be found in the plugin registry errors even for empty entries. In Hop GUI this can happen during project activation, when ExecutionPerspective.restoreOpenTabs() reopens historical executions and reconstructs their saved metadata. It does not necessarily indicate a problem with the current project's connections.

There is a second issue when an unavailable type does contain objects: the skip loop stops at the first END_ARRAY token, rather than the end of the metadata type's array. A real Neo4j connection contains manualUrls: []; the graph database connection also contains this array nested under graphDatabase.NEO4J. Either shape can leave the reader positioned inside a skipped connection and interfere with loading subsequent metadata types.

Implementation

  • Require each metadata type's value to be an array and advance to its first element before resolving the metadata class.
  • Skip empty arrays immediately, without a plugin lookup or a misleading error.
  • For nonempty arrays whose metadata plugin cannot be resolved, retain the existing error diagnostic and use skipChildren() on each element. This skips complete objects, including nested arrays, and resumes at the next metadata type.
  • Load known types starting from the already-read first element. The serialized format and existing legacy-key resolution remain unchanged.

Regression coverage uses the existing Neo4j integration fixture and graph database connection sample shapes, including their empty manualUrls arrays, and verifies that a following server entry is still loaded when the connection plugin is unavailable. Empty Salesforce and Neo4j entries are also covered without adding dependencies on those plugins.

Note/Context

Encountered it while checking an issue on an environment (final cause was a mixed distro version with hop plugin folder on an older version) so not 100% sure it can happen in real life but thought it was worth fixing and it was fasteasy enough to do it quickly.

@hansva

hansva commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

Please create a linked ticket too

@bamaer

bamaer commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

ticket?

@rmannibucau rmannibucau changed the title Fix serialized metadata loading when optional plugins are unavailable [#9530] Fix serialized metadata loading when optional plugins are unavailable Nov 16, 2026
@rmannibucau

Copy link
Copy Markdown
Contributor Author

Created #9530 (copied the description)

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.

3 participants