Discovery run fails at ConnectionTest on the first run after a restart: per-connection field rows are not loaded
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- backend
Direzione di ricerca
Read packages/Integration/engine/src/IntegrationConnectorCreationPipeline.ts, especially runInternal, LoadCatalogScope, and stageConnectionTest, then trace IntegrationEngineBase.GetIntegrationObjectFields and the connection's catalog rows. Reproduce with a connection that has field rows after restarting MJAPI and running discovery before sync. Done when ConnectionTest handles cold per-connection field rows without falsely reporting a connection failure.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Version: 6.2.2 (LTS). The same code is on the next branch.
What happens
A discovery run (the connector creation pipeline) fails at the ConnectionTest stage on the first run after the MJAPI process starts. The run fails in some milliseconds and makes no call to the external system. A later run in the same process passes, after a sync of the same connection has run.
Example from a connector that reads the fields of its first object to build a small test query:
ConnectionTest failed: [elevate] The Report API door rejected a minimal query for resource "AccountingCode", and reported no reason.
The message points the operator to the site URL and the API key, but the two are correct.
Cause
In packages/Integration/engine/src/IntegrationConnectorCreationPipeline.ts, runInternal calls LoadCatalogScope and then stageConnectionTest. LoadCatalogScope loads the objects and the dependency edges of the connection. It does not load field rows.
When the connection already has its own catalog rows, the connector gets the connection's own objects inside the scope. In TestConnection the connector calls GetCachedFields for one of these objects. In IntegrationEngineBase.GetIntegrationObjectFields the field rows of that object are not warm, and RequireWarmFields is not set for this scope, so assertWarm does not throw. The function continues to the resident index, which has no rows for a per-connection object id, and returns an empty list.
The connector then has no column to query and reports a failed connection.
Why it does not show on each run
- A sync calls WarmCatalogObject for each object it reads. The warm rows stay in the process until the row budget removes them. A discovery run that starts after a sync of the same connection finds the rows and passes.
- A connection with no catalog rows of its own gets the shared declared objects, and their fields are resident.
- A connector that does not read fields in TestConnection is not affected.
So the failure shows only when a discovery run is the first work for that connection after a restart, or after the rows are removed from the cache.
Steps to reproduce
- Use a connection that already has rows in CompanyIntegrationObject and CompanyIntegrationObjectField.
- Use a connector whose TestConnection reads GetCachedFields of an object.
- Restart MJAPI.
- Start a discovery run for the connection before a sync of that connection runs.
Suggested correction
- Before stageConnectionTest, warm the field rows of the object or objects that the connector reads in TestConnection. One option is to warm the first active object of the connection. A second option is to give the connector an async step to name the objects it needs.
- Or run the ConnectionTest stage with RequireWarmFields set, so a read of cold field rows throws PER_CONNECTION_CATALOG_OBJECT_COLD and does not return an empty list. This makes the cause visible but does not make the test pass.
The same condition applies to the IntegrationTestConnection resolver if it calls TestConnection inside a catalog scope without warm field rows. I did not test that path.
- Lingua principale
- TSQL
- Stelle
- 32
- Fork
- 7
- Merge medio
- 1g 16h
- PR unite (30g)
- 504
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di MemberJunction/MJ
-
DBAutoDoc: export --state-file writes SQL Server SQL for a PostgreSQL database, ignoring --providerAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 73/100
MemberJunction/MJ#7094 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
MemberJunction/MJ#6971 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
MemberJunction/MJ#6947 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
MemberJunction/MJ#6800 ·
I maintainer di solito rispondono entro 1 giorno
-
Convention: saved-query discoverability follows Status — Approved is canon, Pending is a draftAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
MemberJunction/MJ#6746 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di MemberJunction/MJ
Issue simili
-
HXsetdir strdup leakAperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 82/100
-
funding: failure logs print `<nil>` error and zero channel IDForse già presa @litbot-9000 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
lightningnetwork/lnd#11676 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
Fei2411/DeepSeek-Bot#2891 ·
-
factory:subtask
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
I maintainer di solito rispondono entro 1 giorno