gs1 / GS1_DigitalLink_Resolver_CE

The GS1 DigitalLink Resolver Community Edition
Apache License 2.0
41 stars 26 forks source link

upsertURIEntry Error for itemDescription #74

Closed ablears closed 3 months ago

ablears commented 11 months ago

I am getting a success response from the resolver (v2.6) in some instances where there is an error processing the itemDescription.

POST /resolver 200 338.961 ms - 38 DEBUG: resolverEntry { identificationKeyType: 'gtin', identificationKey: '00710497245371', dateInserted: '2023-12-13T00:18:59.000Z', dateLastUpdated: '2023-12-13T00:18:59.000Z', itemDescription: 'Fresh, pure, dry and textural. One of the rising star white varieties of McLaren Vale. Made mostly in tank to preserve the aromatic and varietal freshness, a small proportion was fermented and aged', qualifierPath: '/', active: true, responses: [ { linkType: 'gs1:pip', ianaLanguage: 'en', mimeType: 'text/html', linkTitle: 'Fiano', targetUrl: 'https://www.bondarwines.com.au/products/2023-fiano', defaultLinkType: true, defaultIanaLanguage: true, defaultContext: true, defaultMimeType: true, fwqs: false, active: true, context: 'us' } ], validationCode: 0 } DEBUG: officialDef { identificationKeyType: '01', identificationKey: '00710497245371', SUCCESS: true } Wed, 13 Dec 2023 00:19:00 GMT >> upsertURIEntry Error: The incoming tabular data stream (TDS) remote procedure call (RPC) protocol stream is incorrect. Parameter 5 ("@itemDescription"): Data type 0xE7 has an invalid data length or metadata length. Wed, 13 Dec 2023 00:19:00 GMT >> Inside the ErrorHandler function of resolver_data_entry_service Wed, 13 Dec 2023 00:19:00 GMT >> Cannot read properties of undefined (reading '0') -- TypeError Wed, 13 Dec 2023 00:19:00 GMT >> {} Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client at new NodeError (node:internal/errors:372:5) at ServerResponse.setHeader (node:_http_outgoing:576:11) at ServerResponse.header (/app/node_modules/express/lib/response.js:794:10) at ServerResponse.send (/app/node_modules/express/lib/response.js:174:12) at ServerResponse.json (/app/node_modules/express/lib/response.js:278:15) at errorHandler (/app/middleware/errorHandler.js:23:31) at Layer.handle_error (/app/node_modules/express/lib/router/layer.js:71:5) at trim_prefix (/app/node_modules/express/lib/router/index.js:326:13) at /app/node_modules/express/lib/router/index.js:286:9 at Function.process_params (/app/node_modules/express/lib/router/index.js:346:12) DEBUG: addDataURIEntry() calling processBatchAndValidateEntries() DEBUG: addDataURIEntry() sending response - batchIdAndEntriesObj = { batchId: 1462871584, badEntries: [] } DEBUG: processBatchToSaveDataEntries()

Firstly, the description I am POSTing in this example is way under the 2000 character limit I see in the resolver's DB schema, so what is causing

Parameter 5 ("@itemDescription"): Data type 0xE7 has an invalid data length or metadata length

Secondly, the response I am getting does not indicate an issue:

HTTP Status Code: 200 {"batchId":xxxxxx,"badEntries":[]}"

nicklansley commented 3 months ago

Apologies for this I am now focussed on Resolver v3.0 and I have have stopped maintenance on v2.6. I hope you find the far simpler v3.0 to your liking!