Issue
It's been days since I've been trying to deploy with no avail using GitLab CI/CD to Heroku via a local GitLab Runner on Windows PowerShell (job log snippet below):
Running with gitlab-runner 15.4.0 (43b2dc3d)
on R1 gYmo5ZZy
Resolving secrets
Preparing the "shell" executor
Using Shell executor...
Preparing environment
Running on DESKTOP-*******...
Getting source from Git repository
Fetching changes with git depth set to 20...
Reinitialized existing Git repository in C:/GitLab-Runner/builds/gYmo5ZZy/0/mernguys/learn-gitlab-ultimate-trial/.git/
Checking out 3f46edc0 as master...
Removing .dpl/
git-lfs/2.6.1 (GitHub; windows amd64; go 1.11.1; git dc072c3e)
Skipping Git submodules setup
Executing "step_script" stage of the job script
$ gem install dpl
Successfully installed dpl-1.10.16
Parsing documentation for dpl-1.10.16
Done installing documentation for dpl after 0 seconds
1 gem installed
$ dpl --provider=heroku --app=%HEROKU_APP_NAME% --api-key=%HEROKU_PRODUCTION_KEY%
Installing deploy dependencies
The system cannot find the path specified.
The system cannot find the path specified.
authentication succeeded
checking for app [MASKED]
found app [MASKED]
Cleaning up git repository with git stash --all. If you need build artifacts for deployment, set deploy.skip_cleanup: true. See https://docs.travis-ci.com/user/deployment#Uploading-Files-and-skip_cleanup.
No local changes to save
creating application archive
uploading application archive
`<?xml version="1.0" encoding="UTF-8"?> <Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>EN1C6ME3D2YG6HJ0</RequestId><HostId>Hhht2DwvnIyMCFazTLXrRer9I99Gxpaw2MHLwP/0ImlETnat5D2KIhsbO9ZckrSm8//JI99xlrQ=</HostId></Error>`curl: (6) Could not resolve host: application
curl: (6) Could not resolve host: version=3'
curl: (6) Could not resolve host: dpl
triggering new deployment
Channel is not registered.
curl: (6) Could not resolve host: application
curl: (6) Could not resolve host: version=3'
curl: (6) Could not resolve host: dpl
No stash entries found.
deploy failed
Preparing deploy
Deploying application
Cleaning up project directory and file based variables
ERROR: Job failed: exit status 1
The problem happens right when it reaches the "uploading application archive" step. Any help would be appreciated.
Solution
On Windows, curl
can have difficulties with quotes meant for a Linux environment.
In your case, using a WSL2 Linux environment for your GitLab runner (installed through the relevant package) might be easier to debug/make it run.
check also if you have to remove/re-login your Heroku application.
Answered By - VonC Answer Checked By - David Marino (WPSolving Volunteer)