HodorNV / ALOps

ALOps
59 stars 24 forks source link

Docker Start: Access to the path 'C:\WINDOWS\TEMP\*' is denied. #390

Closed jcoe-nvt closed 3 years ago

jcoe-nvt commented 3 years ago

Describe the bug 'Docker start' fails sometimes to rename duplicate addin folders

The used yaml

- task: ALOpsDockerCreate@1
  displayName: 'Create Docker Image - $(country) / Current Build'
  inputs:    
    artifactcountry: $(country)
    artifacttype: ${{ parameters.artifacttype }}
    artifactversion: '18.1' # Current version
    includetesttoolkit: true
    includetestlibrariesonly: true
    includetestframeworkonly: true
    licensefile: $(alops-bc-license)

- task: ALOpsDockerStart@1
  displayName: 'Start Docker Container'
  inputs:    
    docker_parameters: '--isolation=hyperv'
    memory_gb: 12

The output Also the complete output is necessary for us to see what is going on. Also use backtics:

2021-06-15T13:33:46.5854421Z ##[section]Starting: Start Docker Container
2021-06-15T13:33:46.5945590Z ==============================================================================
2021-06-15T13:33:46.5945790Z Task         : ALOps Docker Start
2021-06-15T13:33:46.5945946Z Description  : Start a Business Central container
2021-06-15T13:33:46.5946093Z Version      : 1.443.2515
2021-06-15T13:33:46.5946211Z Author       : Hodor
2021-06-15T13:33:46.5946356Z Help         : Start Business Central docker container.
2021-06-15T13:33:46.5946559Z ==============================================================================
2021-06-15T13:33:47.5616505Z *** Using ALOpsDockerCreate image, disabling [docker_pull]
2021-06-15T13:33:47.5622683Z *** Importing required PS-Functions
2021-06-15T13:33:47.8029928Z *** Validate configuration
2021-06-15T13:33:48.0142334Z *** Task Inputs:
2021-06-15T13:33:48.0186068Z 
2021-06-15T13:33:48.0427332Z name                        value                                                       
2021-06-15T13:33:48.0430342Z ----                        -----                                                       
2021-06-15T13:33:48.0432518Z fixed_tag                                                                               
2021-06-15T13:33:48.0434465Z ignore_no_container_warning False                                                       
2021-06-15T13:33:48.0434936Z docker_image                myimage:sandbox-18.1.24822.26791-w1-10.0.17763.1282-ltsc2019
2021-06-15T13:33:48.0437476Z accept_image_eula           True                                                        
2021-06-15T13:33:48.0438069Z accept_image_outdated       True                                                        
2021-06-15T13:33:48.0440068Z enable_symbol_loading       False                                                       
2021-06-15T13:33:48.0440522Z enable_api_services         False                                                       
2021-06-15T13:33:48.0442647Z multitenant                 False                                                       
2021-06-15T13:33:48.0443181Z docker_pull                 True                                                        
2021-06-15T13:33:48.0444700Z dockerauthentication        None                                                        
2021-06-15T13:33:48.0445310Z docker_login                                                                            
2021-06-15T13:33:48.0446716Z docker_username                                                                         
2021-06-15T13:33:48.0447227Z docker_password                                                                         
2021-06-15T13:33:48.0448709Z docker_registry                                                                         
2021-06-15T13:33:48.0449214Z memory_gb                   12                                                          
2021-06-15T13:33:48.0451016Z container_restart           no                                                          
2021-06-15T13:33:48.0451901Z docker_parameters           --isolation=hyperv                                          
2021-06-15T13:33:48.0453404Z sql_server                                                                              
2021-06-15T13:33:48.0454305Z sql_server_instance                                                                     
2021-06-15T13:33:48.0455850Z sql_database                                                                            
2021-06-15T13:33:48.0456699Z sql_database_user                                                                       
2021-06-15T13:33:48.0458335Z sql_database_user_password                                                              
2021-06-15T13:33:48.0458830Z sql_backup_file                                                                         
2021-06-15T13:33:48.0460345Z encryption_key                                                                          
2021-06-15T13:33:48.0460588Z 
2021-06-15T13:33:48.0482995Z 
2021-06-15T13:33:48.0488926Z 
2021-06-15T13:33:48.0627417Z *** For documentation, please visit   : https://www.alops.be/documentation
2021-06-15T13:33:48.0630609Z 
2021-06-15T13:33:48.3658910Z *** ALOps License:
2021-06-15T13:33:48.3737121Z   * Licensed To: Navitrans
2021-06-15T13:33:48.3750554Z 
2021-06-15T13:33:48.4576911Z *** Memory Status: 18.79/31.84 (59.02% Free)
2021-06-15T13:33:48.6036673Z *** Splitting Additional Docker Parameters
2021-06-15T13:33:48.6046145Z *** Additional Docker parameters:
2021-06-15T13:33:48.6059423Z --isolation=hyperv
2021-06-15T13:33:48.6105089Z *** Add docker parameter: --isolation=hyperv
2021-06-15T13:33:48.6120276Z ##[command]"docker" create --memory 12G --env accept_eula=Y --env accept_outdated=Y --restart no --label TFSBuild=Templates_14049 --isolation=hyperv myimage:sandbox-18.1.24822.26791-w1-10.0.17763.1282-ltsc2019
2021-06-15T13:33:48.7376129Z *** Checking for Assemblies in App
2021-06-15T13:33:48.8852717Z *** Create TempFile
2021-06-15T13:33:48.8950288Z *** Test Docker-Path: [/Program Files/Microsoft Dynamics NAV/180/Service/Add-ins/]
2021-06-15T13:33:49.1492575Z *** Cleanup TempFile
2021-06-15T13:33:49.1528373Z *** BC Service Folder: [/Program Files/Microsoft Dynamics NAV/180/Service/Add-ins/]
2021-06-15T13:33:49.1637585Z *** Assemblies in App found. Adding Probing Paths (50).
2021-06-15T13:33:49.1669577Z   * C:\DockerInstallation\Agent2\_work\8\s\Artifacts\Addins\Astrata Connector
2021-06-15T13:33:49.3884523Z   * C:\DockerInstallation\Agent2\_work\8\s\Artifacts\Addins\b.Alert Connector
2021-06-15T13:33:49.6095384Z   * C:\DockerInstallation\Agent2\_work\8\s\Artifacts\Addins\E-Navitrans Connector
2021-06-15T13:33:49.8320671Z   * C:\DockerInstallation\Agent2\_work\8\s\Artifacts\Addins\Excel Templates
2021-06-15T13:33:50.0527819Z   * C:\DockerInstallation\Agent2\_work\8\s\Artifacts\Addins\Fleetboard Connector
2021-06-15T13:33:50.2685905Z   * C:\DockerInstallation\Agent2\_work\8\s\Artifacts\Addins\OnPrem\Barcode
2021-06-15T13:33:50.4799425Z   * C:\DockerInstallation\Agent2\_work\8\s\Artifacts\Addins\OnPrem\iTextHelper
2021-06-15T13:33:50.7253371Z   * C:\DockerInstallation\Agent2\_work\8\s\Artifacts\Addins\OnPrem\License
2021-06-15T13:33:50.9421868Z   * C:\DockerInstallation\Agent2\_work\8\s\Artifacts\Addins\OnPrem\MsgReader
2021-06-15T13:33:51.1639500Z   * C:\DockerInstallation\Agent2\_work\8\s\Artifacts\Addins\OnPrem\Printer Helper
2021-06-15T13:33:51.3734726Z   * C:\DockerInstallation\Agent2\_work\8\s\Artifacts\Addins\OnPrem\Word Connector
2021-06-15T13:33:51.5984070Z   * C:\DockerInstallation\Agent2\_work\8\s\Artifacts\Addins\OnPrem\ZebraIntegration
2021-06-15T13:33:51.8145938Z   * C:\DockerInstallation\Agent2\_work\8\s\Artifacts\Addins\OnPrem\ZXingHelper
2021-06-15T13:33:52.0317217Z   * C:\DockerInstallation\Agent2\_work\8\s\Artifacts\Addins\Route Optimiser ST
2021-06-15T13:33:52.2453576Z   * C:\DockerInstallation\Agent2\_work\8\s\Artifacts\Addins\Timocom Connector
2021-06-15T13:33:52.4613388Z   * C:\DockerInstallation\Agent2\_work\8\s\Artifacts\Addins\Transics Connector
2021-06-15T13:33:52.6852043Z   * C:\DockerInstallation\Agent2\_work\8\s\Artifacts\Addins\Transwide Connector
2021-06-15T13:33:52.9039911Z   * C:\DockerInstallation\Agent2\_work\8\s\Artifacts\Addins\Trimble Connector
2021-06-15T13:33:53.1204491Z   * C:\DockerInstallation\Agent2\_work\8\s\Artifacts\Addins\xTour Connector
2021-06-15T13:33:53.3432339Z   * C:\DockerInstallation\Agent2\_work\8\s\Artifacts\Addins\Xynaps Connector
2021-06-15T13:33:53.5648034Z   * C:\DockerInstallation\Agent2\_work\8\s\PreviousApps\Addins\Astrata Connector
2021-06-15T13:33:53.5685467Z *** Duplicate folder [Astrata Connector], renaming [v2]
2021-06-15T13:33:54.0654701Z   * C:\DockerInstallation\Agent2\_work\8\s\PreviousApps\Addins\b.Alert Connector
2021-06-15T13:33:54.0663829Z *** Duplicate folder [b.Alert Connector], renaming [v2]
2021-06-15T13:33:54.2898179Z   * C:\DockerInstallation\Agent2\_work\8\s\PreviousApps\Addins\E-Navitrans Connector
2021-06-15T13:33:54.2904744Z *** Duplicate folder [E-Navitrans Connector], renaming [v2]
2021-06-15T13:33:54.5232585Z   * C:\DockerInstallation\Agent2\_work\8\s\PreviousApps\Addins\Excel Templates
2021-06-15T13:33:54.5242241Z *** Duplicate folder [Excel Templates], renaming [v2]
2021-06-15T13:33:54.8283316Z   * C:\DockerInstallation\Agent2\_work\8\s\PreviousApps\Addins\Fleetboard Connector
2021-06-15T13:33:54.8294094Z *** Duplicate folder [Fleetboard Connector], renaming [v2]
2021-06-15T13:33:55.0249204Z ##[error]Access to the path 'C:\WINDOWS\TEMP\qnsfcygp.eat\Fleetboard Connector' is denied.
2021-06-15T13:33:55.0426496Z ##[section]Finishing: Start Docker Container

Expected behavior No error when starting docker container

waldo1001 commented 3 years ago

Can you narrow down "sometimes"? I see it's complaining about permissions - may be a certain build agent?

jcoe-nvt commented 3 years ago

@waldo1001 pipeline ran 2 times today and failed 2 times with same warning. In both cases rerunning the failed pipeline was the solution. I would do some more runs to verify that it happens every time on the first run, but DevOps seems to be down :(

waldo1001 commented 3 years ago

We will try to use a different temp-folder for this .. will keep you posted.
Could you also check the user that is running the agent, and the permissions?

jcoe-nvt commented 3 years ago

Service is running as Local System as explained in your 'ALOps Introduction' video

waldo1001 commented 3 years ago

Hey @jcoe-nvt ,

did you check diskspace? does it occur on all build agents?

jcoe-nvt commented 3 years ago

We have more than 300GB free space. It only happened on 1 of the build agents and currently it doesn't seem to happen anymore. So I'm not sure under what conditions this error occurs 😟

fvet commented 3 years ago

FYI, this error is still present and happens in random runs of the same pipeline on the same build server / build agent, although most of the times on the same folder:

2021-06-15T13:33:53.5648034Z   * C:\DockerInstallation\Agent2\_work\8\s\PreviousApps\Addins\Astrata Connector
2021-06-15T13:33:53.5685467Z *** Duplicate folder [Astrata Connector], renaming [v2]
2021-06-15T13:33:54.0654701Z   * C:\DockerInstallation\Agent2\_work\8\s\PreviousApps\Addins\b.Alert Connector
2021-06-15T13:33:54.0663829Z *** Duplicate folder [b.Alert Connector], renaming [v2]
2021-06-15T13:33:54.2898179Z   * C:\DockerInstallation\Agent2\_work\8\s\PreviousApps\Addins\E-Navitrans Connector
2021-06-15T13:33:54.2904744Z *** Duplicate folder [E-Navitrans Connector], renaming [v2]
2021-06-15T13:33:54.5232585Z   * C:\DockerInstallation\Agent2\_work\8\s\PreviousApps\Addins\Excel Templates
2021-06-15T13:33:54.5242241Z *** Duplicate folder [Excel Templates], renaming [v2]
2021-06-15T13:33:54.8283316Z   * C:\DockerInstallation\Agent2\_work\8\s\PreviousApps\Addins\Fleetboard Connector
2021-06-15T13:33:54.8294094Z *** Duplicate folder [Fleetboard Connector], renaming [v2]
2021-06-15T13:33:55.0249204Z ##[error]Access to the path 'C:\WINDOWS\TEMP\qnsfcygp.eat\Fleetboard Connector' is denied.
2021-06-15T13:33:55.0426496Z ##[section]Finishing: Start Docker Container
jcoe-nvt commented 3 years ago

@waldo1001 have you found a solution for this issue?

If not, wouldn't it be possible to solve #366 in another way? Instead of moving and renaming the addins to temp folders, just to copy the addins with the original full subpath (starting from working directory) inside the docker container.

waldo1001 commented 3 years ago

We have a solution - it's in test now .. I hope to release this weekend if all other tests succeed.

waldo1001 commented 3 years ago

And - what you suggest isn't that straight forward in powershell in combo with Docker, I'm afraid.. .

AdminHodor commented 3 years ago

Dear @jcoe-nvt ,

Please try our latest release, v1.444. The issue seemed to be a "File-Lock" error instead of the "Access Denied"

Kind regards,