How force stop job at the end


I use gitlab for CI.

When I push, the job is ok but never completes.

How can I tell the job that I have finished?

I use powershell.

Last command executed:

asadmin start-domain domain1
 Attempting to start domain1.... Please look at the server log for more details.....
infinite time

I try to put - exit 1 but same

Thank you.

Hey do you use the gitlab-ci.yaml file? Can you show it here please?


yes I am using gitlab-ci.yml, here is the content.

It always blocks in the same place, the service does not want to stop.

    - build

    stage: build
        - app-prod
        - git config --system core.longpaths true
        - ./stop-service.ps1
        - cp -r -fo "packages\app\" "packages\app\.env"
        - npm run bootstrap
        - npm run build
        - Start-Service -Name "appServer"
        - master


$serviceName = 'appServer';

Stop-Service -Name $serviceName

$service = Get-Service -Name $serviceName

while ($service.Status -ne 'Stopped') {


log gitlab

warning: failed to remove node_modules/canvas/build/Release/libpangowin32-1.0-0.dll: Invalid argument

43 warning: failed to remove node_modules/canvas/build/Release/libpcre2-8-0.dll: Invalid argument

44 warning: failed to remove node_modules/canvas/build/Release/libpixman-1-0.dll: Invalid argument

45 warning: failed to remove node_modules/canvas/build/Release/libpng16-16.dll: Invalid argument

46 warning: failed to remove node_modules/canvas/build/Release/librsvg-2-2.dll: Invalid argument

47 warning: failed to remove node_modules/canvas/build/Release/libstdc+±6.dll: Invalid argument

48 warning: failed to remove node_modules/canvas/build/Release/libthai-0.dll: Invalid argument

49 warning: failed to remove node_modules/canvas/build/Release/libwinpthread-1.dll: Invalid argument

50 warning: failed to remove node_modules/canvas/build/Release/libxml2-2.dll: Invalid argument

51 warning: failed to remove node_modules/canvas/build/Release/zlib1.dll: Invalid argument

52 warning: failed to remove packages/appServer/dist/: Permission denied

54 ERROR: Job failed: exit status 1

Thank you

Are you sure it’s a problem of gitlab ci ? If you you do it on a local machine is it working?

If I run the script on a local machine yes it works. The service stops and then I do the orders and it’s ok.
but when I run the runner it still blocks as if it is not waiting for the end of the script.
I really don’t see the problem

I don’t have a solution, but did you give to the job the credentials, env variable,… that you have in your local machine?

I don’t need variable but for authentication I don’t know. Does the runner run everything in admin mode or do I have to do something?
Thank you.

I’m not sure about it but I think the runner runs in admin mode yes.

Is your error coming from this line ?

No my error comes from deleting the files in the target directory.
The service is not stopped when the runner deletes the files. I have “permission denied”

Where are these files? Are these files on your gitlab repository ?

All files are on the gitlab repository.
When running the runner, all files are deleted in the destination directory and then uploaded via gitlab

I don’t know if you have this information but when you launch a runner the files of the repo are not directly accessible with a regular path. This is because they are in a specific directory. You can find it with this CI variable: CI_PROJECT_DIR (echo it with in a script job for example).
I don’t know if it can help