BotFramework-Composer icon indicating copy to clipboard operation
BotFramework-Composer copied to clipboard

publish fails with ERR_INVALID_CHAR Invalid character in header content [\"Authorization\"]\n

Open chrbsg opened this issue 2 years ago • 16 comments

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 botcomposer-deploy-fail

Version

2.1.2

Browser

  • [*] Electron distribution
  • [ ] Chrome
  • [ ] Safari
  • [ ] Firefox
  • [ ] Edge

OS

  • [ ] macOS
  • [ ] Windows
  • [*] Ubuntu

To Reproduce

Steps to reproduce the behavior:

  1. Get json from provisionComposer
  2. Add json publish target
  3. click publish
  4. See error

Expected behavior

Publish should work

Screenshots

botcomposer-deploy-fail

Additional context

chrbsg avatar Jun 10 '22 09:06 chrbsg

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?

anishprasad01 avatar Jun 10 '22 16:06 anishprasad01

Closing this issue due to inactivity. If you still require assistance, please comment and we can reopen the issue.

anishprasad01 avatar Jun 17 '22 22:06 anishprasad01

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.

chrbsg avatar Jun 23 '22 11:06 chrbsg

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).

anishprasad01 avatar Jun 23 '22 16:06 anishprasad01

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?

chrbsg avatar Jun 24 '22 10:06 chrbsg

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").

chrbsg avatar Jun 24 '22 10:06 chrbsg

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.

anishprasad01 avatar Jun 24 '22 14:06 anishprasad01

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).

chrbsg avatar Jun 24 '22 14:06 chrbsg

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.

chrbsg avatar Jun 24 '22 14:06 chrbsg

Is your account connected to multiple tenants, and are your resources being created in your home tenant (or the correct tenant)?

anishprasad01 avatar Jun 24 '22 18:06 anishprasad01

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.

chrbsg avatar Jun 27 '22 11:06 chrbsg

PR #9225 that addresses this issue has been merged.

msomanathan avatar Jul 11 '22 18:07 msomanathan

@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.

chrbsg avatar Jul 19 '22 16:07 chrbsg

Hi @chrbsg, are you using a proxy server by any chance when attempting to publish?

ramfattah avatar Aug 11 '22 18:08 ramfattah

@ramfattah No proxy server

chrbsg avatar Aug 11 '22 18:08 chrbsg

@chrbsg, do you face the same issue if using Composer 2.1.1?

ramfattah avatar Aug 11 '22 23:08 ramfattah

Closing due to inactivity. @chrbsg, please re-open if needed.

ramfattah avatar Aug 22 '22 23:08 ramfattah