Closed dylanw-oss closed 6 months ago
I ran into the same issue when using azure-kusto-data V5. It blocks me to get a daily report generated by kusto data and hosted on function app. Wondering if there is a workaround and the ETA for the fix.
We have just released v6.0.1 which should have a fix for this, does it still happen to you in this version?
Hi AsaMah,
I updated the package to V6.0.1, unfortunately, I still get the same error when testing it in my function app. [A screenshot of a computer Description automatically generated]
I can confirm I'm using the latest package in my code and uploaded it successfully to my function app. The following is the package.json file in azure-kusto-data in node_moudles folder that I downloaded from my function app, I it shows the package version V6 as expected. [A screen shot of a computer code Description automatically generated]
From: AsafMah @.> Sent: Monday, April 8, 2024 9:49 PM To: Azure/azure-kusto-node @.> Cc: Lufeng Ren @.>; Comment @.> Subject: Re: [Azure/azure-kusto-node] Kusto query failed in Teams web service with error "Invalid character in header content ["x-ms-app"]" (Issue #299)
We have just released v6.0.1 which should have a fix for this, does it still happen to you in this version?
- Reply to this email directly, view it on GitHubhttps://github.com/Azure/azure-kusto-node/issues/299#issuecomment-2044142357, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AXCQPKWC2ISKZHZPV53LYBDY4NXNFAVCNFSM6AAAAABFIIK3IWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBUGE2DEMZVG4. You are receiving this because you commented.Message ID: @.***>
edit: tl;dr: A workaround for the issue is reverting to an older node version.
I am running into a similar issue with the x-ms-app header, but I have some useful additional information.
I will try tomorrow with the 6.0.1 version and see if that helps.
edit: here is the relevant part of our code:
kcs = KustoConnectionStringBuilder.withSystemManagedIdentity(clusterConnectionString)
const kustoClient = new KustoClient(kcs)
const clientRequestProps = new ClientRequestProperties()
const oneMinute = 1000 * 60
clientRequestProps.setTimeout(oneMinute)
clientRequestProps.clientRequestId = `${config.applicationName};${getGuid()}`
clientRequestProps.setOption('Application', config.applicationName)
const results = await kustoClient.execute(database, query, clientRequestProps)
edit2: The issue is still present in version 6.0.1
We have the same problem since three days, the problem seems to be that the default value for x-ms-app
uses process.title
(https://github.com/Azure/azure-kusto-node/blob/master/packages/azure-kusto-data/src/clientDetails.ts#L36), which contains the whole node command line with invalid chars.
On our azure function app the header looks like this: 'x-ms-app': '"node" "C:\\Program Files (x86)\\SiteExtensions\\Functions\\4.31.0\\workers\\node\\dist/src/nodejsWorker.js" --host 127.0.0.1 --port 50705 --workerId b362f703-4028-48e4-a945-fae900b8262a --requestId c1508d5b-9737-4ed1-b955-fa5fefc0d388 --grpcMaxMessageLength 2147483647 --functions-uri http://127.0.0.1:50705/ --functions-worker-id b362f703-4028-48e4-a945-fae900b8262a --functions-request-id c1508d5b-9737-4ed1-b955-fa5fefc0d388 --functions-grpc-max-message-length 2147483647ݡ韐ਵ\x03'
(Checked with KustoConnectionStringBuilder.withSystemManagedIdentity(ADX_URL).clientDetails().getHeaders()
I'm re-opening, we have just released 6.0.2 that should fix this issue.
Please let us know if you're still having it after upgrading.
@AsafMah just upgraded, errors no longer occur. Thanks for the speedy resolution.
@AsafMah, I verified it with package 6.0.2 and this error no longer occur. 🎉🎉🎉 Thanks for the speedy resolution!
Describe the bug Kuso query failed in Teams web service with error message ""Invalid character in header content ["x-ms-app"]". I'm not sure if this is a Teams Framework or Kusto bug. The same code works in local testing but failed when running in Teams web service in Azure. https://github.com/microsoft/teams-ai/issues/1443
To Reproduce Add a Kusto query function to Teams bot, and I explicitly set "x-ms-app" header with code as below, but not working. Can anyone help me understand if this is the right way to setup "x-ms-app" header? or in which situation kustoClient.execute throw this exception "Invalid character in header content ["x-ms-app"]"? how to fix it? Appreciated!
Expected behavior no exception
Screenshots Got this error in Azure log stream:
Setup:
Browser Setup:
Desktop:
Additional context ...