BotFramework-Composer
BotFramework-Composer copied to clipboard
publish fails with ERR_INVALID_CHAR Invalid character in header content [\"Authorization\"]\n
Describe the bug
I followed the provisioning instructions at https://aka.ms/how-to-complete-provision-handoff and got the JSON output from provisionComposer.js then added it as a publish configuration in Bot Framework Composer. Clicking publish shows an error:
DEPLOY_ZIP_ERROR - There was a problem publishing bot assets (zip deploy).
{"stack": "TypeError [ERR_INVALID_CHAR]: Invalid character in header content [\"Authorization\"]\n at ClientRequest.setHeader (_http_outgoing.js:448:3)\n at new ClientRequest
...
Note that the error text can not be copied and pasted. I would consider this another bug? I've uploaded a screenshot
Version
2.1.2
Browser
- [*] Electron distribution
- [ ] Chrome
- [ ] Safari
- [ ] Firefox
- [ ] Edge
OS
- [ ] macOS
- [ ] Windows
- [*] Ubuntu
To Reproduce
Steps to reproduce the behavior:
- Get json from provisionComposer
- Add json publish target
- click publish
- See error
Expected behavior
Publish should work
Screenshots
Additional context
Hi @chrbsg,
What version of Azure CLI did you install? This document is somewhat outdated, and Azure CLI has very recently introduced some breaking changes that affect the existing bot provisioning steps. If you installed the latest version, could you please install version 2.36.0
instead and retry the publishing process?
Closing this issue due to inactivity. If you still require assistance, please comment and we can reopen the issue.
I downgraded azure-cli to 2.36.0 (apt-get install azure-cli=2.36.0-1~focal
) but still get the same error when trying to publish a bot.
In that case, could you attempt to follow the Composer publish steps instead of the handoff steps, and let us know if that works for you? The easiest way would probably be to create all new resources and then delete them immediately after testing to avoid charges (assuming you do not wish to keep this bot up).
When I attempt to follow the "Create new resources" path, the "Configure resources" dialog says:
There was an authentication problem retrieving subscriptions. Verify your login session has not expired and you have permission to list subscriptions in this account.
There are no subscriptions selectable due to this error, so I can't continue.
It's possible that my account doesn't have the correct permissions - what specifically should I ask the administrator to enable?
If I try "Import existing Azure resources" then I get the same error as with the handoff steps ("DEPLOY_ZIP_ERROR TypeError ERR_INVALID_CHAR Invalid character in header content Authorization").
The creation process will require resources such as an Azure Bot, an App Service, and often things like a storage account, LUIS, or QnA Maker to be created. You would need the permissions to be able to create and modify such resources.
The administrator thinks I already have the required permissions - I can create bots in the portal, web test works, and I can provision resources using the "handoff" commands. The thing that doesn't work is publishing from Bot Framework Composer - either "Create new resources" (what exactly is required for "permission to list subscriptions in this account"?), or publish after handoff (Invalid character in header content Authorization).
I have also successfully run a local bot, and set the messaging endpoint on the Azure portal bot configuration to point to it, and tested with the web test, and that worked. So it looks like the general permissions for bots are ok, but there could be a specific permission which "publish" in Bot Framework Composer requires which has been overlooked.
Is your account connected to multiple tenants, and are your resources being created in your home tenant (or the correct tenant)?
My account has two tenants
-
f8cdef31-a31e-4b4a-93e4-5f571e91255a
- this appears to be the Microsoft default tenant for personal accounts
- no subscriptions on this account
-
187646cf-2996-4d3c-9030-c45bdb0cd6af
- business account
- subscription 287bf1db-97ca-4454-9f90-86a480438f74
In Azure Portal, default tenant is set to the business account.
When I try to publish a bot, I do:
az login --tenant azure.speech-graphics.net --use-device-code
(for some reason, I get an empty Chrome tab unless I use --use-device-code)
az account get-access-token
az account get-access-token --resource-type ms-graph
Then, with these tokens, trying publish>"create new resources", I get "There was an authentication problem retrieving subscriptions. Verify your login session has not expired and you have permission to list subscriptions in this account".
If I try publish>"import existing resources", then enter the tenantID and subscriptionID of the business account, along with the access token from az account get-access-token
, then I get the DEPLOY_ZIP_ERROR error.
PR #9225 that addresses this issue has been merged.
@msomanathan as noted above, PR #9225 did not fix my issue. I was still unable to publish a bot after downgrading and pinning the azure-cli version with apt-get install azure-cli=2.36.0-1~focal
.
Hi @chrbsg, are you using a proxy server by any chance when attempting to publish?
@ramfattah No proxy server
@chrbsg, do you face the same issue if using Composer 2.1.1?
Closing due to inactivity. @chrbsg, please re-open if needed.