Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

teamsApp/publishAppPackage fails with BadRequest for some localizations #12358

Open
alexanderbob opened this issue Sep 9, 2024 · 5 comments
Open
Assignees
Labels

Comments

@alexanderbob
Copy link

alexanderbob commented Sep 9, 2024

Describe the bug
Running provisioning fails at the teamsApp/publishAppPackage stage with the following message:

Error: Unable to make API call to Developer Portal: Error, BadRequest, API name: publish-app, X-Correlation-ID: cc2f521b-b7f7-4cf2-adf1-ad5612c92192. This may be due to a temporary service error. Try again after a few minutes. data: {"error":{"code":"BadRequest","message":"BadRequest","innerError":{"code":"BadRequest","date":"2024-09-09T20:42:30","request-id":"90d35443-509f-41d9-81b9-4c789f2aebec","client-request-id":"90d35443-509f-41d9-81b9-4c789f2aebec"}}}

{
  "errorType": "SystemError",
  "source": "Fx-VS",
  "name": "UnknownError",
  "message": "The JSON-RPC connection with the remote party was lost before the request could complete.",
  "stack": "   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at StreamJsonRpc.JsonRpc.<InvokeCoreAsync>d__165.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n  ...
  "innerError": null,
  "userData": null,
  "timestamp": "2024-09-09T13:42:17.7659121-07:00",
  "displayMessage": "The JSON-RPC connection with the remote party was lost before the request could complete.",
  "helpLink": null,
  "issueLink": null
}

With trial and error, we narrowed this issue down to the length of localization properties.

For example, with manifest like the one below:

{
    "$schema": "https://developer.microsoft.com/json-schemas/teams/vDevPreview/MicrosoftTeams.schema.json",
    "manifestVersion": "devPreview",
    "version": "1.0.0",
    "id": "f12389cc-a4de-471e-a341-f413efc6f8cf",
    "packageName": "Microsoft.Dynamics.Sales.Productivity",
    "localizationInfo": {
        "defaultLanguageTag": "en-US",
        "additionalLanguages": [
            {
                "languageTag": "pl-PL",
                "file": "pl-PL.json"
            }
        ]
    },
    ...
}

And pl-PL.json file contents as the following:

{
    "$schema": "https://developer.microsoft.com/json-schemas/teams/vDevPreview/MicrosoftTeams.Localization.schema.json",
    "name.short": "Copilot dla działów sprzedaży",
    "name.full": "Copilot dla działów sprzedaży",
    "description.short": "Usługa...",
    "description.full": "...",
    ...
}

Provisioning fails with the error above.

Howver, shortening name.short string solves the issue:

{
    "$schema": "https://developer.microsoft.com/json-schemas/teams/vDevPreview/MicrosoftTeams.Localization.schema.json",
    "name.short": "dla działów sprzedaży",
    "name.full": "Copilot dla działów sprzedaży",
    "description.short": "Usługa...",
    "description.full": "...",
    ...
}

Schema file declares that max length for name.short is 30 characters:
image

However, all 3 strings for name.short property on lines 1-3 are causing provisioning to fail. Removing "Copilot" to shorten the string value (lines 6-8) solves the issue.
image

  1. Copilot dla działów sprzedaży
  2. Copilot pārdošanas nodaļām
  3. Copilot dành cho Bán hàng

Looks like API endpoint incorrectly counts length for multi-symbol unicode characters, because all 3 are no longer than 30 characters, but caret position is at 33/31 symbol.

Microsoft Visual Studio Enterprise 2022
Version 17.11.2
VisualStudio.17.Release/17.11.2+35222.181

Copy link
Contributor

Thank you for contacting us! Any issue or feedback from you is quite important to us. We will do our best to fully respond to your issue as soon as possible. Sometimes additional investigations may be needed, we will usually get back to you within 2 days by adding comments to this issue. Please stay tuned.

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs attention This issue needs the attention of a contributor. label Sep 9, 2024
Copy link

github-actions bot commented Sep 9, 2024

Based on the status code and API name in error message, this issue is duplicated with #10316. You can refer to it for more information.

@github-actions github-actions bot added close-wait The issue will be closed automatically if no update *duplicate This issue or pull request already exists labels Sep 9, 2024
@alexanderbob alexanderbob changed the title teamsApp/publishAppPackage fails with BadRequest teamsApp/publishAppPackage fails with BadRequest when name.short contains non-ASCII text Sep 10, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot removed the close-wait The issue will be closed automatically if no update label Sep 10, 2024
@alexanderbob alexanderbob changed the title teamsApp/publishAppPackage fails with BadRequest when name.short contains non-ASCII text teamsApp/publishAppPackage fails with BadRequest for some localizations Sep 10, 2024
@alexanderbob
Copy link
Author

I narrowed it down to the following locales:

  1. lv-LV
  2. vi-VN
  3. pl-PL

Updated original post.

@XiaofuHuang
Copy link
Contributor

@alexanderbob Thank you for reporting the issue. We are currently working on resolving it.

@adashen adashen added investigating TA:E2E Team Area: E2E and removed *duplicate This issue or pull request already exists labels Sep 11, 2024
@anchenyi
Copy link
Contributor

anchenyi commented Sep 12, 2024

As discussed in Teams, the API endpoint correctly counts the characters. We will improve the error message for localization files' json schema validation.

@eriolchan eriolchan removed the needs attention This issue needs the attention of a contributor. label Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants