HodorNV / ALOps

ALOps
59 stars 24 forks source link

Authentification issue while running autotests #454

Closed gntpet closed 2 years ago

gntpet commented 2 years ago

Hey @waldo1001,

We are experiencing strange issue with authentification while running automated tests (InvalidCredentialsError). Any clue why it is happening?

Here's the steps we use to create image, start container, and run tests:

          - task: ALOpsDockerCreate@1
            displayName: 'ALOPS - Create Docker Image' 
            inputs:
              artifactversion: ${{ parameters.baseVersion }}
              artifactcountry: 'w1'
              artifacttype: OnPrem
              includetesttoolkit: true
              licensefile: $(Pipeline.Workspace)\k3license\fin.flf
              myscripts: $(Agent.BuildDirectory)\templates\AdditionalSetup.ps1
              dockerregistry: 'k3devops.azurecr.io'
              imageprefix: 'imv'
              forcecreateimage: ${{ parameters.forceImageCreate }} 

          - task: ALOpsDockerStart@1
            name: ALOpsDockerStartUsingBackup
            condition: and(succeeded(), eq(variables['useBackup'], True))
            inputs:
              docker_pull: True
              dockerregistry: 'k3devops.azurecr.io'
              sql_backup_file: C:\Run\BAK\$(backupFileName)
              docker_parameters: |
                --volume $(Build.SourcesDirectory)\MV\dlls\:c:\run\Add-ins\LSRetail
                --volume c:\bcartifacts.cache:c:\dl
                --volume C:\ProgramData\BcContainerHelper:C:\ProgramData\BcContainerHelper
                --volume $(backupFileFolder):C:\Run\BAK
                --env locale=nl-NL

          - task: ALOpsDockerWait@1
            inputs:
              search_string: 'Ready for connections!'
              setup_working_folder: false

          - task: ALOpsAppTest@1
            inputs:
              usedocker: true
              testfilter: '50000..99999'
              import_testtoolkit: false
              failed_test_action: 'Error'
              testpage: 90409
              companyname: AutoTest
              show_available_tests: true
              timeoutInMinutes: 30
              bc_username: $(ALOPS_DOCKER_ADMINUSER)
              bc_password: $(ALOPS_DOCKER_ADMINPASSWORD)
              bc_authentication: NavUserPassword
              nav_serverinstance: $(ALOPS_DOCKER_NAVSERVERINSTANCE)

here are the logs we get when starting container:

2021-11-19T11:30:58.6126784Z ##[section]Starting: ALOpsDockerStartUsingBackup
2021-11-19T11:30:58.6221625Z ==============================================================================
2021-11-19T11:30:58.6221973Z Task         : ALOps Docker Start
2021-11-19T11:30:58.6222243Z Description  : Start a Business Central container
2021-11-19T11:30:58.6222490Z Version      : 1.445.2647
2021-11-19T11:30:58.6222704Z Author       : Hodor
2021-11-19T11:30:58.6222976Z Help         : Start Business Central docker container.
2021-11-19T11:30:58.6223283Z ==============================================================================
2021-11-19T11:30:59.8709550Z *** Using ALOpsDockerCreate image, disabling [docker_pull]
2021-11-19T11:30:59.8719600Z *** Importing required PS-Functions
2021-11-19T11:31:00.3335062Z *** Validate configuration
2021-11-19T11:31:00.6533288Z *** Task Inputs:
2021-11-19T11:31:00.6606121Z 
2021-11-19T11:31:00.6754521Z name                        value                                                                                      
2021-11-19T11:31:00.6757087Z ----                        -----                                                                                      
2021-11-19T11:31:00.6759648Z fixed_tag                                                                                                              
2021-11-19T11:31:00.6761723Z ignore_no_container_warning False                                                                                      
2021-11-19T11:31:00.6764568Z docker_image                ***.azurecr.io/imv:onprem-14.18.45015.0-w1-10.0.17763.2300-ltsc2019                   
2021-11-19T11:31:00.6766766Z accept_image_eula           True                                                                                       
2021-11-19T11:31:00.6768924Z accept_image_outdated       True                                                                                       
2021-11-19T11:31:00.6770944Z enable_symbol_loading       False                                                                                      
2021-11-19T11:31:00.6773099Z enable_api_services         False                                                                                      
2021-11-19T11:31:00.6775098Z multitenant                 False                                                                                      
2021-11-19T11:31:00.6778197Z docker_pull                 True                                                                                       
2021-11-19T11:31:00.6779683Z dockerauthentication        None                                                                                       
2021-11-19T11:31:00.6782262Z docker_login                                                                                                           
2021-11-19T11:31:00.6784600Z docker_username                                                                                                        
2021-11-19T11:31:00.6787247Z docker_password                                                                                                        
2021-11-19T11:31:00.6789502Z docker_registry                                                                                                        
2021-11-19T11:31:00.6792110Z memory_gb                   -1                                                                                         
2021-11-19T11:31:00.6794279Z container_restart           no                                                                                         
2021-11-19T11:31:00.6796103Z licensefile                                                                                                            
2021-11-19T11:31:00.6798728Z docker_parameters           --volume C:\a\1\s\MV\dlls\:c:\run\Add-ins\LSRetail...                                      
2021-11-19T11:31:00.6800915Z sql_server                                                                                                             
2021-11-19T11:31:00.6803489Z sql_server_instance                                                                                                    
2021-11-19T11:31:00.6806780Z sql_database                                                                                                           
2021-11-19T11:31:00.6807578Z sql_database_user                                                                                                      
2021-11-19T11:31:00.6808358Z sql_database_user_password                                                                                             
2021-11-19T11:31:00.6809270Z sql_backup_file             C:\Run\BAK\8ea8680ebf_20211119_100652.bak                                                  
2021-11-19T11:31:00.6811740Z encryption_key                                                                                                         
2021-11-19T11:31:00.6812434Z 
2021-11-19T11:31:00.6848122Z 
2021-11-19T11:31:00.6861951Z 
2021-11-19T11:31:00.7018209Z *** For documentation, please visit   : https://www.alops.be/documentation
2021-11-19T11:31:00.7021722Z 
2021-11-19T11:31:01.0548745Z *** ALOps License:
2021-11-19T11:31:01.0570106Z   * Licensed To: K3 Business Solutions (Project License)
2021-11-19T11:31:01.0574512Z 
2021-11-19T11:31:01.2292117Z *** Splitting Additional Docker Parameters
2021-11-19T11:31:01.2302460Z *** Additional Docker parameters:
2021-11-19T11:31:01.2320591Z --volume C:\a\1\s\MV\dlls\:c:\run\Add-ins\LSRetail
2021-11-19T11:31:01.2321199Z --volume c:\bcartifacts.cache:c:\dl
2021-11-19T11:31:01.2321798Z --volume C:\ProgramData\BcContainerHelper:C:\ProgramData\BcContainerHelper
2021-11-19T11:31:01.2322438Z --volume C:\a\1\backup\Dynamics 365:C:\Run\BAK
2021-11-19T11:31:01.2322914Z --env locale=nl-NL
2021-11-19T11:31:01.2420265Z *** Add docker parameter: --volume C:\a\1\s\MV\dlls\:c:\run\Add-ins\LSRetail
2021-11-19T11:31:01.2430639Z *** Add docker parameter: --volume c:\bcartifacts.cache:c:\dl
2021-11-19T11:31:01.2440772Z *** Add docker parameter: --volume C:\ProgramData\BcContainerHelper:C:\ProgramData\BcContainerHelper
2021-11-19T11:31:01.2450846Z *** Add docker parameter: --volume C:\a\1\backup\Dynamics 365:C:\Run\BAK
2021-11-19T11:31:01.2460744Z *** Add docker parameter: --env locale=nl-NL
2021-11-19T11:31:01.2480309Z ##[command]"docker" create --env accept_eula=Y --env accept_outdated=Y --env bakfile="C:\Run\BAK\8ea8680ebf_20211119_100652.bak" --restart no --label TFSBuild=MV_69551 --volume C:\a\1\s\MV\dlls\:c:\run\Add-ins\LSRetail --volume c:\bcartifacts.cache:c:\dl --volume C:\ProgramData\BcContainerHelper:C:\ProgramData\BcContainerHelper --volume C:\a\1\backup\Dynamics 365:C:\Run\BAK --env locale=nl-NL ***.azurecr.io/imv:onprem-14.18.45015.0-w1-10.0.17763.2300-ltsc2019
2021-11-19T11:31:01.3527476Z *** Checking for Assemblies in App
2021-11-19T11:31:01.4935373Z *** Create TempFile
2021-11-19T11:31:01.5045587Z *** Test Docker-Path: [/Program Files/Microsoft Dynamics NAV/140/Service/Add-ins/]
2021-11-19T11:31:01.8872127Z *** Cleanup TempFile
2021-11-19T11:31:01.8944159Z *** BC Service Folder: [/Program Files/Microsoft Dynamics NAV/140/Service/Add-ins/]
2021-11-19T11:31:01.9057034Z *** Assemblies in App found. Adding Probing Paths (19).
2021-11-19T11:31:01.9089852Z   * C:\a\1\s\MV\DLLs\FTP
2021-11-19T11:31:02.3163150Z   * C:\a\1\s\MV\DLLs\LSRetail\DD
2021-11-19T11:31:02.5610054Z   * C:\a\1\s\MV\DLLs\LSRetail\Facebook
2021-11-19T11:31:02.7648344Z   * C:\a\1\s\MV\DLLs\LSRetail\Hammock
2021-11-19T11:31:02.9636752Z   * C:\a\1\s\MV\DLLs\LSRetail\LSRecommend
2021-11-19T11:31:03.1884098Z   * C:\a\1\s\MV\DLLs\LSRetail\Lucene.Net
2021-11-19T11:31:03.3870045Z   * C:\a\1\s\MV\DLLs\LSRetail\Newtonsoft.Json
2021-11-19T11:31:03.5851793Z   * C:\a\1\s\MV\DLLs\LSRetail\POS
2021-11-19T11:31:03.9130170Z   * C:\a\1\s\MV\DLLs\LSRetail\TweetSharp
2021-11-19T11:31:04.1222985Z   * C:\a\1\s\MV\DLLs\TrafficLIght
2021-11-19T11:31:04.3169282Z   * C:\a\1\s\MV\Docker\images\1904-cu4-w1-ltsc2016\resources
2021-11-19T11:31:04.6546006Z   * C:\a\1\s\MV\Docker\images\1904-cu4-w1-ltsc2019\resources
2021-11-19T11:31:04.6615782Z *** Duplicate folder [resources], renaming [v2]
2021-11-19T11:31:05.0722053Z   * C:\a\1\s\MV\Docker\images\1904-cu4-w1-ltsc2019\resources\ID
2021-11-19T11:31:05.2642809Z   * C:\a\1\s\MV\Docker\images\1904-cu4-w1-ltsc2019\resources\SG
2021-11-19T11:31:05.4608660Z   * C:\a\1\s\MV\Docker\images\2017-cu11-ls11.03\resources
2021-11-19T11:31:05.4618167Z *** Duplicate folder [resources], renaming [v3]
2021-11-19T11:31:05.7820874Z   * C:\a\1\s\MV\Docker\images\2017-cu9-ls11.03\resources
2021-11-19T11:31:05.7832721Z *** Duplicate folder [resources], renaming [v4]
2021-11-19T11:31:06.0794510Z   * C:\a\1\s\MV\Docker\images\2018-cu2-ls11.03\resources
2021-11-19T11:31:06.0806003Z *** Duplicate folder [resources], renaming [v5]
2021-11-19T11:31:06.3850389Z   * C:\a\1\s\MV\Docker\images\2018-cu6-ls11.03\resources
2021-11-19T11:31:06.3861114Z *** Duplicate folder [resources], renaming [v6]
2021-11-19T11:31:06.6638423Z   * C:\a\1\s\MV\Scripts.v2\PsTestTool-6
2021-11-19T11:31:06.8699807Z ##[command]"docker" start 57158334cfb9e0cc4065d2353465d6d1c10298cd18b4ad989014ad40158d2c97
2021-11-19T11:31:08.0204862Z *** Container Started: 57158334cfb9e0cc4065d2353465d6d1c10298cd18b4ad989014ad40158d2c97
2021-11-19T11:31:08.3949595Z *** Container Labels:
2021-11-19T11:31:08.4098856Z 
2021-11-19T11:31:08.5415511Z *** Docker Start OK.
2021-11-19T11:31:08.5417763Z *** Cleanup VSTS Environment: True
2021-11-19T11:31:10.5391151Z ##[section]Async Command Start: Add Build Tag
2021-11-19T11:31:10.5392350Z Build '69551' has following tags now: ***.azurecr.io/imv-onprem-14.18.45015.0-w1-10.0.17763.2300-ltsc2019
2021-11-19T11:31:10.5392707Z ##[section]Async Command End: Add Build Tag
2021-11-19T11:31:10.5393544Z ##[section]Async Command Start: Add Build Tag
2021-11-19T11:31:10.5394075Z Build '69551' has following tags now: BC.Platform.14.0.45012.0, ***.azurecr.io/imv-onprem-14.18.45015.0-w1-10.0.17763.2300-ltsc2019
2021-11-19T11:31:10.5394445Z ##[section]Async Command End: Add Build Tag
2021-11-19T11:31:10.5395167Z ##[section]Async Command Start: Add Build Tag
2021-11-19T11:31:10.5395710Z Build '69551' has following tags now: BC.Version.14.18.45015.0, BC.Platform.14.0.45012.0, ***.azurecr.io/imv-onprem-14.18.45015.0-w1-10.0.17763.2300-ltsc2019
2021-11-19T11:31:10.5396828Z ##[section]Async Command End: Add Build Tag
2021-11-19T11:31:10.5397809Z ##[section]Finishing: ALOpsDockerStartUsingBackup

here are the logs we get when running tests:

2021-11-19T11:34:11.4736216Z ##[section]Starting: ALOpsAppTest
2021-11-19T11:34:11.4883720Z ==============================================================================
2021-11-19T11:34:11.4884220Z Task         : ALOps App Test
2021-11-19T11:34:11.4884667Z Description  : Run AL-TestSuite for Business Central
2021-11-19T11:34:11.4885092Z Version      : 1.445.2647
2021-11-19T11:34:11.4885420Z Author       : Hodor
2021-11-19T11:34:11.4885825Z Help         : Run Business Central Test-Suite and collect results.
2021-11-19T11:34:11.4886316Z ==============================================================================
2021-11-19T11:34:13.8747598Z *** Validate configuration
2021-11-19T11:34:14.2534002Z *** Task Inputs:
2021-11-19T11:34:14.2604468Z 
2021-11-19T11:34:14.2741699Z name                           value
2021-11-19T11:34:14.2742371Z ----                           -----
2021-11-19T11:34:14.2744252Z usedocker                       True
2021-11-19T11:34:14.2745363Z fixed_tag                           
2021-11-19T11:34:14.2746556Z nav_serverinstance               NAV
2021-11-19T11:34:14.2747432Z tenant                       default
2021-11-19T11:34:14.2748337Z companyname                 AutoTest
2021-11-19T11:34:14.2749219Z profile                             
2021-11-19T11:34:14.2750258Z bc_username                    ***
2021-11-19T11:34:14.2750987Z bc_password                 Gotu1538
2021-11-19T11:34:14.2751861Z bc_authentication    NavUserPassword
2021-11-19T11:34:14.2752597Z bc_webclient_url                    
2021-11-19T11:34:14.2753503Z testfilter              50000..99999
2021-11-19T11:34:14.2754362Z disabledtests                       
2021-11-19T11:34:14.2755250Z show_available_tests            True
2021-11-19T11:34:14.2755963Z import_testtoolkit             False
2021-11-19T11:34:14.2756880Z import_action              Overwrite
2021-11-19T11:34:14.2757627Z testpage                       90409
2021-11-19T11:34:14.2758711Z testsuite                    DEFAULT
2021-11-19T11:34:14.2759581Z extensionid                         
2021-11-19T11:34:14.2760529Z installaltesttool              False
2021-11-19T11:34:14.2761422Z failed_test_action             Error
2021-11-19T11:34:14.2762299Z override_finsql_path                
2021-11-19T11:34:14.2763424Z resultfilename       TestResults.xml
2021-11-19T11:34:14.2763781Z 
2021-11-19T11:34:14.2785425Z 
2021-11-19T11:34:14.2796649Z 
2021-11-19T11:34:14.2958635Z *** For documentation, please visit   : https://www.alops.be/documentation
2021-11-19T11:34:14.2961914Z 
2021-11-19T11:34:14.5675777Z *** ALOps License:
2021-11-19T11:34:14.5697039Z   * Licensed To: K3 Business Solutions (Project License)
2021-11-19T11:34:14.5700851Z 
2021-11-19T11:34:14.5809481Z *** Importing required PS-Functions
2021-11-19T11:34:14.8165546Z *** Working folder: C:\a\1\s
2021-11-19T11:34:14.8174047Z ***
2021-11-19T11:34:14.8183259Z *** Prepare Docker Session
2021-11-19T11:34:15.9073137Z *** Connect Docker Session
2021-11-19T11:34:15.9192662Z *** Initiate Docker Session
2021-11-19T11:34:17.0874167Z *** Set Docker Container ErrorActionPreference = Stop
2021-11-19T11:34:22.1183531Z *** Copy Modules to Docker
2021-11-19T11:34:26.2689690Z *** Setup Docker Session
2021-11-19T11:34:26.2999764Z *** Checking for container-specific Test Assemblies
2021-11-19T11:34:26.3015363Z *** Using container-specific Test Assemblies
2021-11-19T11:34:26.3224107Z *** Import Modules in Docker Session
2021-11-19T11:34:26.3363492Z *** Import UI Client [C:\Run\DevOps\BCAppTest\bin\Microsoft.Dynamics.Framework.UI.Client.dll]
2021-11-19T11:34:26.3394311Z VERBOSE: Loading module from path 'C:\Run\DevOps\BCAppTest\bin\Microsoft.Dynamics.Framework.UI.Client.dll'.
2021-11-19T11:34:26.7635000Z *** Import NewtonSoft JSON [C:\Program Files\Microsoft Dynamics NAV\140\Service\Newtonsoft.Json.dll]
2021-11-19T11:34:26.7773160Z *** Import Modules in Docker Session: class_ClientContext
2021-11-19T11:34:37.6114691Z *** Test Context Url: https://57158334cfb9/NAV/cs?tenant=default&company=AutoTest
2021-11-19T11:34:37.6128938Z *** Setup BC Credentials in Docker
2021-11-19T11:34:37.7981315Z *** Resolve Docker Credentials
2021-11-19T11:34:37.8007827Z *** Set TCP Keep-Alive
2021-11-19T11:34:37.8207704Z *** Start TestSuite
2021-11-19T11:34:37.8903181Z *** Running TestSuite with authentication [NavUserPassword] with User [***]
2021-11-19T11:34:37.8920604Z *** Run warm-up with page [90409]
2021-11-19T11:34:37.8937781Z *** Warm-up Client Context
2021-11-19T11:34:41.7815844Z InvalidCredentialsError
2021-11-19T11:34:41.7834450Z at <ScriptBlock>, <No file>: line 143
2021-11-19T11:34:41.7843498Z at AwaitState, <No file>: line 220
2021-11-19T11:34:41.7853096Z at OpenSession, <No file>: line 198
2021-11-19T11:34:41.7863117Z at Initialize, <No file>: line 59
2021-11-19T11:34:41.7873474Z at ClientContext, <No file>: line 26
2021-11-19T11:34:41.7882932Z at New-ClientContext, <No file>: line 27
2021-11-19T11:34:41.7891795Z at <ScriptBlock>, <No file>: line 10
2021-11-19T11:34:41.7901561Z at <ScriptBlock>, <No file>: line 1
2021-11-19T11:34:48.4748538Z *** Warm-Up Exception: ClientSession State is Uninitialized (Wait time 10 seconds)
2021-11-19T11:34:48.4760215Z *** Warm-up Client Context failed: retry
2021-11-19T11:34:53.4804112Z *** Warm-up Client Context
2021-11-19T11:34:58.5859077Z InvalidCredentialsError
2021-11-19T11:34:58.5863105Z at <ScriptBlock>, <No file>: line 143
2021-11-19T11:34:58.5869165Z at AwaitState, <No file>: line 220
2021-11-19T11:34:58.5873847Z at OpenSession, <No file>: line 198
2021-11-19T11:34:58.7676232Z at Initialize, <No file>: line 59
2021-11-19T11:34:58.7679604Z at ClientContext, <No file>: line 26
2021-11-19T11:34:58.7682394Z at New-ClientContext, <No file>: line 27
2021-11-19T11:34:58.7685045Z at <ScriptBlock>, <No file>: line 10
2021-11-19T11:34:58.7687788Z at <ScriptBlock>, <No file>: line 1
2021-11-19T11:35:03.7988152Z *** Warm-Up Exception: ClientSession State is Uninitialized (Wait time 10 seconds)
2021-11-19T11:35:03.8000573Z *** Warm-up Client Context failed: retry
2021-11-19T11:35:09.6658826Z *** Warm-up Client Context
2021-11-19T11:35:15.9871534Z InvalidCredentialsError
2021-11-19T11:35:15.9877722Z at <ScriptBlock>, <No file>: line 143
2021-11-19T11:35:15.9883024Z at AwaitState, <No file>: line 220
2021-11-19T11:35:15.9884170Z at OpenSession, <No file>: line 198
2021-11-19T11:35:15.9890278Z at Initialize, <No file>: line 59
2021-11-19T11:35:15.9900246Z at ClientContext, <No file>: line 26
2021-11-19T11:35:15.9910460Z at New-ClientContext, <No file>: line 27
2021-11-19T11:35:16.0004751Z at <ScriptBlock>, <No file>: line 10
2021-11-19T11:35:16.0015559Z at <ScriptBlock>, <No file>: line 1
2021-11-19T11:35:19.8766547Z *** Warm-Up Exception: ClientSession State is Uninitialized (Wait time 10 seconds)
2021-11-19T11:35:19.8778012Z *** Warm-up Client Context failed: retry
2021-11-19T11:35:25.0577111Z *** Warm-up Client Context
2021-11-19T11:35:27.1622609Z InvalidCredentialsError
2021-11-19T11:35:27.1625403Z at <ScriptBlock>, <No file>: line 143
2021-11-19T11:35:27.1629986Z at AwaitState, <No file>: line 220
2021-11-19T11:35:27.1635572Z at OpenSession, <No file>: line 198
2021-11-19T11:35:27.1639898Z at Initialize, <No file>: line 59
2021-11-19T11:35:27.1644094Z at ClientContext, <No file>: line 26
2021-11-19T11:35:27.1648685Z at New-ClientContext, <No file>: line 27
2021-11-19T11:35:27.1652595Z at <ScriptBlock>, <No file>: line 10
2021-11-19T11:35:27.1660809Z at <ScriptBlock>, <No file>: line 1
2021-11-19T11:35:36.2791513Z *** Warm-Up Exception: ClientSession State is Uninitialized (Wait time 10 seconds)
2021-11-19T11:35:36.2795988Z *** Warm-up Client Context failed: retry
2021-11-19T11:35:41.6358156Z *** Warm-up Client Context
2021-11-19T11:36:16.7489589Z InvalidCredentialsError
2021-11-19T11:36:16.7494427Z at <ScriptBlock>, <No file>: line 143
2021-11-19T11:36:16.7506139Z at <ScriptBlock>, <No file>: line 21
2021-11-19T11:36:16.7517009Z at <ScriptBlock>, <No file>: line 1
2021-11-19T11:36:16.7525693Z *** Warm-Up Exception: ClientSession State is Uninitialized (Wait time 34 seconds)
2021-11-19T11:36:16.7537888Z *** Warm-up Client Context failed: retry
2021-11-19T11:36:21.7559813Z ##[error]Warm-up Client Context failed
2021-11-19T11:36:21.8399646Z ##[error]Because the session state for session WinRM1, 5142e11e-7cbb-4ea0-92b2-e426009237f8, 57158334cfb9e0cc4065d2353465d6d1c10298cd18b4ad989014ad40158d2c97 is not equal to Open, you cannot run a command  in the session.  The session state is Closing.
2021-11-19T11:36:21.8681706Z ##[section]Finishing: ALOpsAppTest
gntpet commented 2 years ago

My guestimate is that docker "dockerstart" does not recreate BC user when using in combination with sqlbackup. it restores the database, sees that user with such a name already exists, and does not update the password for it. Could you check this theory on your side, guys?

waldo1001 commented 2 years ago

That might very well be the case.

Question - why not use the same password? 🤔

gntpet commented 2 years ago

Because I'm not in control of the password management code. ALOPS does that for me. There's no option for me to pass user/password to ALOpsDockerStart

waldo1001 commented 2 years ago

No, what I mean is, just provide the same password as in the database for running tests?

image

gntpet commented 2 years ago

I do. the problem is that backup contains password from the previous run.

          - task: ALOpsAppTest@1
            inputs:
              usedocker: true
              testfilter: '50000..99999'
              import_testtoolkit: false
              failed_test_action: 'Error'
              testpage: 90409
              companyname: AutoTest
              show_available_tests: true
              timeoutInMinutes: 30
              bc_username: $(ALOPS_DOCKER_ADMINUSER)
              bc_password: $(ALOPS_DOCKER_ADMINPASSWORD)
              bc_authentication: NavUserPassword
              nav_serverinstance: $(ALOPS_DOCKER_NAVSERVERINSTANCE)
waldo1001 commented 2 years ago

Hm, so you don't have the password, correct?

gntpet commented 2 years ago

let's see example

Run1

Run2

Hope the picture is clearer now

waldo1001 commented 2 years ago

hm, so you want us to make an option to reset the user 🤔. That's harder than you think - we can't just always do that.

Do know you can script your way into the db with ALOpsDockerExec ... 🤔

gntpet commented 2 years ago

well, I think ALOpsDockerStart just creates BC user using BC shell commands "new-navserveruser". So you just need to check if user already exists, and if yes change his password using "Set-navserveruser" command.

p.s. i am guessing here, since I didn't see your sourcecode.

in my opinion it should be fixed within standard ALOPS, since I am just using pure ALOPS commands. I am not using custom dbs, just the ones that ALOPS created and made backup of it.

gntpet commented 2 years ago

one more thing, it seems that you already do some magic with the BC Credentials in ALOpsAppTest step

image

waldo1001 commented 2 years ago

We checked.

We don't create users - this is default "NAVDocker" scripts that are executed in the BC Containers.

So, ALOps is not doing any magic in terms of "users" on top of how default NAV Docker stuff works. Re-using an existing database kind of requires you to know the password. So if you use a database that is created by the NAVDocker scripts from MS, then you'll have to find a way to remember the password.

Suggestion - Remove the users from the database before the backup. This should help you in that: https://www.waldo.be/2012/12/05/nav-2013-how-to-log-in-any-database/

You could also just build a database that you can re-use all the time, that you manage yourself, and then use that in all pipelines, with a managed user.

waldo1001 commented 2 years ago

You have feedback according to my suggestions?

waldo1001 commented 2 years ago

Will close issue since there hasn't been any feedback. Please re-open if it's still an issue ..