HodorNV / ALOps

ALOps
59 stars 24 forks source link

Deploy to BC22 On-premise failed - Service Unavailable #630

Closed hfaisal8 closed 1 year ago

hfaisal8 commented 1 year ago

Deploying App through DevOps Release pipelines to BC22 on-premise is failing due to error :

Service request failed.
Status: 503 (Service Unavailable)
Content:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Service Unavailable</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Service Unavailable</h2>
<hr><p>HTTP Error 503. The service is unavailable.</p>
</BODY></HTML>
Headers:
Connection: close
Date: Tue, 11 Apr 2023 10:07:20 GMT
Server: Microsoft-HTTPAPI/2.0
Content-Length: 326
Content-Type: text/html; charset=us-ascii

If we check the BC extension management , we can see the new app version is uploaded but not installed :

image

the output

2023-04-11T10:50:26.1227248Z ##[section]Starting: Publish Go4TMS App
2023-04-11T10:50:26.1471491Z ==============================================================================
2023-04-11T10:50:26.1471768Z Task         : ALOps App Publish
2023-04-11T10:50:26.1472032Z Description  : Publish AL Extension to Business Central
2023-04-11T10:50:26.1472199Z Version      : 1.455.3600
2023-04-11T10:50:26.1472337Z Author       : Hodor
2023-04-11T10:50:26.1473234Z Help         : Publish Business Central extension to service tier.
2023-04-11T10:50:26.1474275Z ==============================================================================
2023-04-11T10:50:27.1988404Z *** Validate configuration
2023-04-11T10:50:27.2591596Z *** Task Inputs:
2023-04-11T10:50:27.2656563Z 
2023-04-11T10:50:27.2783465Z name                                                                                                              value
2023-04-11T10:50:27.2786500Z ----                                                                                                              -----
2023-04-11T10:50:27.2788878Z usedocker                                                                                                         False
2023-04-11T10:50:27.2791612Z fixed_tag                                                                                                              
2023-04-11T10:50:27.2794253Z installpublishedapps                                                                                               True
2023-04-11T10:50:27.2797592Z installaltesttool                                                                                                 False
2023-04-11T10:50:27.2800385Z install_al_app_names                                                                             Tests-TestLibraries...
2023-04-11T10:50:27.2802931Z strictappnames                                                                                                     True
2023-04-11T10:50:27.2805048Z nav_serverinstance                                                                                          BC22DEVTEST
2023-04-11T10:50:27.2808678Z artifact_path                                                                                                          
2023-04-11T10:50:27.2811861Z nav_artifact_app_filter                                                                                *_Go4TMS_APP.app
2023-04-11T10:50:27.2815078Z skip_verification                                                                                                  True
2023-04-11T10:50:27.2816800Z forceinstall                                                                                                       True
2023-04-11T10:50:27.2819900Z forcesync                                                                                                          True
2023-04-11T10:50:27.2824638Z publish_scope                                                                                                    Global
2023-04-11T10:50:27.2825191Z tenant                                                                                                          default
2023-04-11T10:50:27.2827922Z batch_publish_folder                                                                                                   
2023-04-11T10:50:27.2832328Z publisherazureactivedirectorytenantid                                                                                  
2023-04-11T10:50:27.2837160Z blocksymbolsonly                                                                                                  False
2023-04-11T10:50:27.2837460Z 
2023-04-11T10:50:27.2871442Z 
2023-04-11T10:50:27.2883511Z 
2023-04-11T10:50:27.3119872Z *** For documentation, please visit   : https://www.alops.be/documentation
2023-04-11T10:50:27.3123997Z 
2023-04-11T10:50:27.6442746Z *** ALOps License:
2023-04-11T10:50:27.6461142Z   * Licensed To: Go4Logistics NV (RepositoryPer5 License)
2023-04-11T10:50:27.6464714Z 
2023-04-11T10:50:27.6567545Z *** Importing required PS-Functions
2023-04-11T10:50:27.8944349Z *** Install AL TestTool: False
2023-04-11T10:50:27.8958730Z *** Working folder: C:\azagent\A1\_work\r5\a
2023-04-11T10:50:27.8972142Z *** Artifact folder: C:\azagent\A1\_work\r5\a
2023-04-11T10:50:27.8984911Z ***
2023-04-11T10:50:27.9056358Z *** Dynamic resolve App file.
2023-04-11T10:50:27.9065171Z *** Scanning [System.DefaultWorkingDirectory].
2023-04-11T10:50:27.9134615Z *** Scanning [System.ArtifactsDirectory].
2023-04-11T10:50:27.9202652Z *** Multiple App files found with filter [*_Go4TMS_APP.app].
2023-04-11T10:50:27.9255584Z   * C:\azagent\A1\_work\r5\a\_APPSOURCE-GO4TMS-PRODUCT-DEV\Go4TMS\Go4Logistics NV_Go4TMS_22.0.2304.11_Go4TMS_APP.app
2023-04-11T10:50:27.9281989Z *** Resolved App File: [C:\azagent\A1\_work\r5\a\_APPSOURCE-GO4TMS-PRODUCT-DEV\Go4TMS\Go4Logistics NV_Go4TMS_22.0.2304.11_Go4TMS_APP.app].
2023-04-11T10:50:27.9636923Z *** Import NAV/BC Management DLL's [False]
2023-04-11T10:50:27.9690971Z *** Loading assemblies for ServiceTier [BC22DEVTEST].
2023-04-11T10:50:28.2422979Z *** Loading assemblies from: [C:\program files\microsoft dynamics 365 business central\220\service]
2023-04-11T10:50:28.2939537Z *** Selected module: [C:\program files\microsoft dynamics 365 business central\220\service\Management\Microsoft.Dynamics.Nav.Management.dll]
2023-04-11T10:50:28.2947759Z *** Loading module: [C:\program files\microsoft dynamics 365 business central\220\service\Management\Microsoft.Dynamics.Nav.Management.dll]
2023-04-11T10:50:28.4002143Z *** Selected module: [C:\program files\microsoft dynamics 365 business central\220\service\Management\Microsoft.Dynamics.Nav.Apps.Management.dll]
2023-04-11T10:50:28.4014373Z *** Loading module: [C:\program files\microsoft dynamics 365 business central\220\service\Management\Microsoft.Dynamics.Nav.Apps.Management.dll]
2023-04-11T10:50:28.4744277Z 
2023-04-11T10:50:28.4780847Z **************************************
2023-04-11T10:50:28.4788690Z  * App File = [C:\azagent\A1\_work\r5\a\_APPSOURCE-GO4TMS-PRODUCT-DEV\Go4TMS\Go4Logistics NV_Go4TMS_22.0.2304.11_Go4TMS_APP.app]
2023-04-11T10:50:28.4792317Z 
2023-04-11T10:50:28.5933041Z  * App.ID        = 0b07e55b-eddd-4ba1-98b0-fb575135ff90
2023-04-11T10:50:28.5962155Z  * App.Name      = Go4TMS
2023-04-11T10:50:28.5982900Z  * App.Publisher = Go4Logistics NV
2023-04-11T10:50:28.6004670Z  * App.Version   = 22.0.2304.11
2023-04-11T10:50:29.1037460Z  => Publishing App 'Go4TMS v22.0.2304.11'
2023-04-11T10:51:09.5417052Z *** Get Tenants
2023-04-11T10:51:15.2878952Z ##[error]Service request failed.
Status: 503 (Service Unavailable)

Content:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Service Unavailable</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Service Unavailable</h2>
<hr><p>HTTP Error 503. The service is unavailable.</p>
</BODY></HTML>

Headers:
Connection: close
Date: Tue, 11 Apr 2023 10:51:15 GMT
Server: Microsoft-HTTPAPI/2.0
Content-Length: 326
Content-Type: text/html; charset=us-ascii

2023-04-11T10:51:15.3384080Z ##[section]Finishing: Publish Go4TMS App

if we use the extension managment window , we could install the app without any problem.

Note 1 : We thought first that is due to old app version installed, but it was not the case (usually Alops unpublish old versions and install the new version without any manual intervene). So we unpublished/uninstalled all old versions and we tried the deployment again but it is still giving the same error.

Note2 : on the same machine we have BC20 on-premise running for other customers , we do not have any issue there deploying applications . So it seems a BC22 issue.

waldo1001 commented 1 year ago

Hi,

Multiple versions on one server is always a challenge.
Did you install bc22? Or copy it? If the latter, please install bc22 as it was a normal installation.

hfaisal8 commented 1 year ago

Hello , We installed BC22 as normal installation ( not a copy) .

waldo1001 commented 1 year ago

Well, there are more than one versions on the system, and my bet is that "it is confused".. :(.

Would you be able to try using ALOPs.ExternalDeployer in stead?

hfaisal8 commented 1 year ago

Actually we have BC18 , BC20 and BC21 installed on our dev server and deployments works great there. Only deployment to BC22 is failing.

So if you there is any clue about what is failling after "Get Tenants" , then we could check the installation/fiewall/permissions...etc.

We can try to use ALOPs.ExternalDeployer but for us it is "temporary" stage before we go to AppSource. So the less changes we do now to our release pipelines will be appreciated :) .

waldo1001 commented 1 year ago

Suggestions:

Can you try a "get-navtenant" yourself on your server?

Is it possible you have configured a non-default management port?

acjdekorte commented 1 year ago

I have got a simular issue with AlOpsExternalDeployer (see below error). The problem in our case had to do with get-navtenant. On the servertier the ManagementApiServicesPort has not default port and ManagementApiServicesEnabled has set to false.

Service request failed. Status: 404 (Not Found)

Content: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">

Not Found

Not Found


HTTP Error 404. The requested resource is not found.

Headers: Connection: close Date: Tue, 16 May 2023 09:58:44 GMT Server: Microsoft-HTTPAPI/2.0 Content-Length: 315 Content-Type: text/html; charset=us-ascii

waldo1001 commented 1 year ago

I hope @acjdekorte 's suggestion worked (for which many thanks! ;-))?

hfaisal8 commented 1 year ago

I have got a simular issue with AlOpsExternalDeployer (see below error). The problem in our case had to do with get-navtenant. On the servertier the ManagementApiServicesPort has not default port and ManagementApiServicesEnabled has set to false.

Service request failed. Status: 404 (Not Found)

Content:

Not Found

Not Found

HTTP Error 404. The requested resource is not found.

Headers: Connection: close Date: Tue, 16 May 2023 09:58:44 GMT Server: Microsoft-HTTPAPI/2.0 Content-Length: 315 Content-Type: text/html; charset=us-ascii

Thank you for the information provided.

For us it was solved by installing BC22 build 55195 . And to be sure : I checked the settings ManagementApiServicesPort and ManagementApiServicesEnabled and there are filled in .

Issue is resolved now.