Trying to access a network drive via GitLab Runner script but get an error (Windows)


#1

I am using the CI component of GitLab and I get this error:

The system cannot find the path specified.

When I try to access a mapped network drive in the script. When try to access the drive normally from my PC (the same one running the service), I can see all the mapped drives.

Here is the script from the .gitlab-yml:

variables:
  PROJECT_NAME: "TestApp"
  STAGING_PATH: X:\some\network\location\%PROJECT_NAME%
stages:
  - build
  - deploy
build:
  stage: build
  script:
  - echo "starting build for %PROJECT_NAME% at %TIME%"
  ...
  artifacts:
    name: "%PROJECT_NAME%"
    paths:
      - '%PROJECT_NAME%/bin/Release'
    expire_in: 1 week
deploy:
  stage: deploy
  script:
    - echo "Deploy to staging server"
    - dir "X:"  << ERROR HAPPENS HERE
    - net use
  dependencies:
    - build
  environment:
    name: staging
  only:
  - master

I have used the net use command to list the network locations it can see but that list is also empty. Is there any way to make gitlab-runner see these network locations?

The runner I am using is the one windows binary obtainable here. The config toml file is:

concurrent = 1
check_interval = 0

[[runners]]
  name = "Haroon-PC"
  url = "http://ae-ubuntu/"
  token = "fd84211a6d37d88d4903317c85ce7a"
  executor = "shell"
  [runners.cache]

#2

I’m having the same issue. The weird thing is that if i use the “Retry” option for the pipeline, sometimes it ends up working


#3

I am also having the same issue, although I have not had any success with pressing “Retry” as
@Narthe has had.


#4

I am having the Same issue!!! I also have not had any success with the retry method