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

Publish-BcContainerApp fails when app has a certain size #3260

Open
CriticalMax opened this issue Dec 1, 2023 · 7 comments
Open

Publish-BcContainerApp fails when app has a certain size #3260

CriticalMax opened this issue Dec 1, 2023 · 7 comments
Assignees

Comments

@CriticalMax
Copy link

Describe the issue
When publishing our main app (65mb) to a cloud sandbox into dev scope we get an unexpected (and unspecific) error.

Scripts used to create container and cause the issue

$authContext = New-BcAuthContext `
    -clientID $entraApp.clientID `
    -clientSecret $entraApp.clientSecret `
    -tenantID $tenantId

Publish-BcContainerApp `
    -bcAuthContext $authcontext `
    -environment $environment `
    -appFile "$App" 

Full output of scripts

Attempting authentication to https://api.businesscentral.dynamics.com/.default u
sing clientCredentials...
Authenticated as app {guid}
Publishing {our_AppName} to https://api.businesscentral.dynamics
.com/v2.0/{our_environment}/dev/apps?SchemaUpdateMode=forcesync
Exception when calling "GetResult" with 0 argument(s): "Error sending the request. 
of the request."
Error sending the request.
The underlying connection was closed: Unknown error

Additional context
We are using service to service auth, which you said wouldn't be possible in a comment under one of your blog posts but the app will still be published and installed despite the error message, it just takes around 10-15 minutes.

We created the app registration as shown in the guide (API.ReadWrite.All, Automation.ReadWrite.All, admin consent granted) and successfully added an entry in the business central entra applications page. Authentication works fine and all of our other apps (way smaller, around 100kb-25mb) don't run into this issue and get published/installed just fine.

Maybe I looked in the wrong places but I couldn't find limitations on the file size except for SOAP services (65,536 kilobytes) which seems to match our app but surely this isn't the problem at hand.

The error stems from the GetResult() method when sending the request to publish the app and I played around with the timeout and other httpHandler properties but that's where my research ended.

As a workaround I created a loop which checks every minute if the app is installed and while this works I would like to know if an app this large is the problem in general or if there really is some kind of problem either in the containerHelper or in Microsoft's handling of the request in the backend.

Do you know of any limitations regarding app file sizes when publishing to cloud environments or could this really be some sort of bug?

@bernyd123
Copy link

Hi there,

I was just wondering if there are any feedback on this issue yet, as I have another partner that is experiencing the same issue as described above. Your feedback in this regard will be greatly appreciated.

Greetings,
Berny During
PTS - BC / MCT Companial

@freddydk
Copy link
Contributor

Sorry, didn't see this issue - if possible, I would like to get my hands on an app, which causes this issue - then I can troubleshoot this.
thanks

@freddydk
Copy link
Contributor

freddydk commented Mar 5, 2024

I tried to make a repro here https://github.com/microsoft/bcsamples-bingmaps.pte/actions/runs/8153202748 - but that doesn't fail.
Please create a repro scenario and provide me with an app and a script which which fails to upload using publish-bccontainerapp.
Thanks

@eclipses
Copy link
Contributor

Hi Freddy,

Facing this issue, please let me know where can I send you copy of the extensions to test it from your side.

Thank you
Eclipses

@freddydk
Copy link
Contributor

You can email a download link to freddyk at microsoft dot com and I will try to repro this.

@freddydk
Copy link
Contributor

On this issue, I did get an app from @eclipses, which failed publishing.
This was a simple out-of-memory exception though - 7Gb was allocated to the container and publishing the app required ~12Gb.
I don't think this is problem from @CriticalMax or @bernyd123 - so if I am to investigate this - I still need something to reproduce this problem.
Without a repro I can spend 100s of hours looking at code without ever finding the reason.

@freddydk
Copy link
Contributor

@CriticalMax - on this

We are using service to service auth, which you said wouldn't be possible in a comment under one of your blog posts but the app will still be published and installed despite the error message, it just takes around 10-15 minutes.

When you publish using s2s - you will NOT publish into dev scope - it will publish into global (PTE) scope - just FYI (which you also can see on the URL (api.businessce....)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants