On GitLab CI the electron build fails with: x509: certificate signed by unknown authority
Since we have set the env-var GIT_SSL_NO_VERIFY to true, this should not happen, right? GitLab Docs
Any idea how to fix this?
Relevant log output:
$ export GIT_SSL_NO_VERIFY=true
..
> nx run dmc-el:make
*********************************************************
DO NOT FORGET TO REBUILD YOUR FRONTEND & BACKEND PROJECTS
FOR PRODUCTION BEFORE PACKAGING / MAKING YOUR ARTIFACT!
*********************************************************
• electron-builder version=22.14.13 os=5.4.109+
• skipped dependencies rebuild reason=npmRebuild is set to false
• packaging platform=linux arch=x64 electron=18.3.4 appOutDir=dist/apps/dmc-executables/linux-unpacked
⨯ Get "https://github.com/electron/electron/releases/download/v18.3.4/electron-v18.3.4-linux-x64.zip": x509: certificate signed by unknown authority
github.com/develar/app-builder/pkg/download.(*Downloader).follow.func1
/Volumes/data/Documents/app-builder/pkg/download/downloader.go:206
github.com/develar/app-builder/pkg/download.(*Downloader).follow
/Volumes/data/Documents/app-builder/pkg/download/downloader.go:234
github.com/develar/app-builder/pkg/download.(*Downloader).DownloadNoRetry
/Volumes/data/Documents/app-builder/pkg/download/downloader.go:128
github.com/develar/app-builder/pkg/download.(*Downloader).Download
/Volumes/data/Documents/app-builder/pkg/download/downloader.go:112
github.com/develar/app-builder/pkg/electron.(*ElectronDownloader).doDownload
/Volumes/data/Documents/app-builder/pkg/electron/electronDownloader.go:192
github.com/develar/app-builder/pkg/electron.(*ElectronDownloader).Download
/Volumes/data/Documents/app-builder/pkg/electron/electronDownloader.go:177
github.com/develar/app-builder/pkg/electron.downloadElectron.func1.1
/Volumes/data/Documents/app-builder/pkg/electron/electronDownloader.go:73
github.com/develar/app-builder/pkg/util.MapAsyncConcurrency.func2
/Volumes/data/Documents/app-builder/pkg/util/async.go:68
runtime.goexit
/usr/local/Cellar/go/1.16.5/libexec/src/runtime/asm_amd64.s:1371
Error: /builds/daqmon/src/node_modules/app-builder-bin/linux/x64/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
at ChildProcess.<anonymous> (/builds/daqmon/src/node_modules/builder-util/src/util.ts:250:14)
at Object.onceWrapper (node:events:642:26)
at ChildProcess.emit (node:events:527:28)
at maybeClose (node:internal/child_process:1092:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
Notes:
when we execute the same commands in a local docker container (same image as used by GitLab CI), it works
The error was not related to git, so GIT_SSL_NO_VERIFY was useless.
The error occurred when electron-builder tried to download some files from GitHub via https.
The solution is to update the CA certficates in the docker-container before executing electron-builder:
apt-get update && apt-get --yes install ca-certificates && update-ca-certificates
I guess that my local docker-container had newer certificates for some reason, than the GitLab CI docker-container.
Thanks Jonas V for the helpful comment!
Related
I just happen to get error unable to get local issuer certificate when running yarn add <anything>.
Yesterday it worked fine, but today it happens out of nowhere, I can't remember doing anything specifically.
After running yarn config set strict-ssl false it becomes working again, but that is very suspicious.
I know my question seems duplicate, but it doesn't. I have been searching everywhere but they seems to be for some cases such as running behind a corporate proxy or doing a new server set up. I am not behind any proxy.
Could you please help me see where should I investigate further to know the real root cause.
I am on macOS Monterey 12.0.1
Full Log
z:~/work/littlepawcraft/mawsay[main !?]$ yarn add html2canvas --verbose
yarn add v1.22.19
verbose 0.185927225 Checking for configuration file "/Users/z/work/littlepawcraft/mawsay/.npmrc".
verbose 0.186249071 Checking for configuration file "/Users/z/.npmrc".
verbose 0.186511794 Found configuration file "/Users/z/.npmrc".
verbose 0.187669087 Checking for configuration file "/usr/local/etc/npmrc".
verbose 0.188048555 Checking for configuration file "/Users/z/work/littlepawcraft/mawsay/.npmrc".
verbose 0.188284222 Checking for configuration file "/Users/z/work/littlepawcraft/.npmrc".
verbose 0.188639829 Checking for configuration file "/Users/z/work/.npmrc".
verbose 0.188928153 Checking for configuration file "/Users/z/.npmrc".
verbose 0.189152548 Found configuration file "/Users/z/.npmrc".
verbose 0.189640273 Checking for configuration file "/Users/.npmrc".
verbose 0.191425842 Checking for configuration file "/Users/z/work/littlepawcraft/mawsay/.yarnrc".
verbose 0.191663753 Checking for configuration file "/Users/z/.yarnrc".
verbose 0.191811016 Found configuration file "/Users/z/.yarnrc".
verbose 0.192157101 Checking for configuration file "/usr/local/etc/yarnrc".
verbose 0.192324062 Checking for configuration file "/Users/z/work/littlepawcraft/mawsay/.yarnrc".
verbose 0.192446487 Checking for configuration file "/Users/z/work/littlepawcraft/.yarnrc".
verbose 0.192626013 Checking for configuration file "/Users/z/work/.yarnrc".
verbose 0.192732424 Checking for configuration file "/Users/z/.yarnrc".
verbose 0.192809809 Found configuration file "/Users/z/.yarnrc".
verbose 0.192994673 Checking for configuration file "/Users/.yarnrc".
verbose 0.196011087 current time: 2022-06-29T01:58:26.170Z
[1/4] 🔍 Resolving packages...
verbose 0.464574716 Performing "GET" request to "https://registry.yarnpkg.com/html2canvas".
verbose 0.619253995 Error: unable to get local issuer certificate
at TLSSocket.onConnectSecure (node:_tls_wrap:1530:34)
at TLSSocket.emit (node:events:390:28)
at TLSSocket._finishInit (node:_tls_wrap:944:8)
at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:725:12)
error An unexpected error occurred: "https://registry.yarnpkg.com/html2canvas: unable to get local issuer certificate".
info If you think this is a bug, please open a bug report with the information provided in "/Users/z/work/littlepawcraft/mawsay/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Check if your .npmrc does not specify manual CAs.
Check if you are behind a corporate proxy.
Check if your local certificates are corrupted.
I run
npx playwright install
in vs code terminal
and getting the next error:
Failed to install browsers
Error: Failed to download Chromium 102.0.5005.40 (playwright build v1005), caused by
Error: self signed certificate in certificate chain
at TLSSocket.onConnectSecure (node:_tls_wrap:1532:34)
at TLSSocket.emit (node:events:527:28)
at TLSSocket._finishInit (node:_tls_wrap:946:8)
at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:727:12)
what can be the issue?
Thanks for advance!
seems like your company is intercepting the traffic, so you need to set the custom certificate via env var
Using the npm install handbrake-js --save command, I installed handbrake-js as a library, and after some tweaking, handbrake-js started to do the job perfectly. And here's the problem. On the local computer everything works well, videos are decoded, etc. BUT (!) When I upload my application to Heroku, handbrake-js stops working.
HandBrake version:
5.0.2
Operating system and version:
macOS 10.15 Catalina
My application uses node js
Error message text:
Here is what information Heroku gives when deploy an application on Heroku:
Linux users
handbrake-cli must be installed separately as the root user.
Ubuntu users can do this using the following commands:
add-apt-repository --yes ppa: stebbins / handbrake-releases
apt-get update -qq
apt-get install -qq handbrake-cli
Heroku Log:
Here's what happens when you try to decode:
2020-12-02T18:34:14.124945+00:00 app[web.1]: Error: Command failed: "HandBrakeCLI" --input "public/images/02122020-123404_338-test.mov" --output "public/images/02122020-123404_338-test.mp4" --preset "Gmail Medium 5 Minutes 480p30"
2020-12-02T18:34:14.124948+00:00 app[web.1]: /bin/sh: 1: HandBrakeCLI: not found
2020-12-02T18:34:14.124948+00:00 app[web.1]:
2020-12-02T18:34:14.124949+00:00 app[web.1]: at ChildProcess.exithandler (child_process.js:308:12)
2020-12-02T18:34:14.124950+00:00 app[web.1]: at ChildProcess.emit (events.js:314:20)
2020-12-02T18:34:14.124950+00:00 app[web.1]: at maybeClose (internal/child_process.js:1022:16)
2020-12-02T18:34:14.124951+00:00 app[web.1]: at Socket.<anonymous> (internal/child_process.js:444:11)
2020-12-02T18:34:14.124951+00:00 app[web.1]: at Socket.emit (events.js:314:20)
2020-12-02T18:34:14.124951+00:00 app[web.1]: at Pipe.<anonymous> (net.js:675:12) {
2020-12-02T18:34:14.124952+00:00 app[web.1]: killed: false,
2020-12-02T18:34:14.124952+00:00 app[web.1]: code: 127,
2020-12-02T18:34:14.124953+00:00 app[web.1]: signal: null,
2020-12-02T18:34:14.124954+00:00 app[web.1]: cmd: '"HandBrakeCLI" --input "public/images/02122020-123404_338-test.mov" --output "public/images/02122020-123404_338-test.mp4" --preset "Gmail Medium 5 Minutes 480p30"'
2020-12-02T18:34:14.124954+00:00 app[web.1]: }
Here is the code used to set up and start decoding:
const options = {
input: req.files.video ? req.files.video[0].path : '',
output: newPathVideo,
preset: 'Gmail Medium 5 Minutes 480p30',
}
async function startEncoding () {
console.log('Start decoding video')
const result = await hbjs.run(options)
console.log(`${result.stdout}End decoding video`)
}
await startEncoding()
For handbrake-js to work correctly, you need to globally install handbrake-cli on the heroku side. For this you need to use a third-party buildpack such as the heroku-buildpack-apt.
To add this buildpack to your application you can use the command
heroku buildpacks:add --index 1 heroku-community/apt -a your-app
Make sure Heroku is installed globally on your computer!
You would need to also create a file named Aptfile on your project root that contains the list of apt packages to be installed such as handbrake-cli.
I have been battling with getting my application up and running in github pages.
i have a hosted repo which i used for testing purpose and i have follow all the steps needed to get the application up and running but all effort avail abortive
git init
git add READMe.md
git commit -m "first commit"
git remote add origin repo url
git push origin master
npm i -g angular-cli-ghpages
ng build --prod --base-href https://username.github.io/repo/
ngh
after this point i am getting the below errors
An error occurred!
Error: Unspecified error (run without silent option for detail)
at C:\Users\TOSHIBA\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\gh-pages\lib\index.js:232:19
at _rejected (C:\Users\TOSHIBA\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\q\q.js:844:24)
at C:\Users\TOSHIBA\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\q\q.js:870:30
at Promise.when (C:\Users\TOSHIBA\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\q\q.js:1122:31)
at Promise.promise.promiseDispatch (C:\Users\TOSHIBA\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\q\q.js:788:41)
at C:\Users\TOSHIBA\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\q\q.js:604:44
at runSingle (C:\Users\TOSHIBA\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\q\q.js:137:13)
at flush (C:\Users\TOSHIBA\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\q\q.js:125:13)
at process._tickCallback (internal/process/next_tick.js:150:11)
i have also tried all possible suggestions online but none worked for me... pls i need help in what i am doing wrong.
update as requested
C:\Users\TOSHIBA\Desktop\Angular\application>ngh --no-silent
Cloning https://github.com/Nazehs/application.git into ......\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\gh-pages.cache
An error occurred!
{ ProcessError: Cloning into '......\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\gh-pages.cache'...
fatal: unable to access 'https://github.com/Nazehs/application.git/': Couldn't resolve host 'github.com'
at ChildProcess.<anonymous> (C:\Users\TOSHIBA\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\gh-pages\lib\git.js:47:23)
at ChildProcess.emit (events.js:160:13)
at maybeClose (internal/child_process.js:943:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
code: 128,
message: 'Cloning into \'..\..\..\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\gh-pages\.cache\'...\nfatal: unable to access \'https://github.com/Nazehs/application.git/\': Couldn\'t resolve host \'github.com\'\n',
name: 'ProcessError' }
new output of the result
Cleaning
Fetching origin
Checking out origin/gh-pages
Removing files
Copying files
Adding all
An error occurred!
{ ProcessError: warning: LF will be replaced by CRLF in 3rdpartylicenses.txt.
The file will have its original line endings in your working directory.
error: open("karma.conf.js"): Permission denied
error: unable to index file karma.conf.js
fatal: adding files failed
at ChildProcess.<anonymous> (C:\Users\TOSHIBA\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\gh-pages\lib\git.js:47:23)
at ChildProcess.emit (events.js:160:13)
at maybeClose (internal/child_process.js:943:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
code: 128,
message: 'warning: LF will be replaced by CRLF in 3rdpartylicenses.txt.\nThe file will have its original line endings in your working directory.\nerror: open("karma.conf.js"): Permission denied\nerror: unable to index file karma.conf.js\nfatal: adding files failed\n',
name: 'ProcessError' }
new error
Pushing
An error occurred!
{ ProcessError: fatal: HttpRequestException encountered.
An error occurred while sending the request.
bash: /dev/tty: No such device or address
error: failed to execute prompt script (exit code 1)
fatal: could not read Username for 'https://github.com': No error
at ChildProcess.<anonymous> (C:\Users\nazehab\AppData\Roaming\npm\node_modules\angular-cli-ghpages\node_modules\gh-pages\lib\git.js:47:23)
at ChildProcess.emit (events.js:182:13)
at maybeClose (internal/child_process.js:961:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
code: 128,
message:
'fatal: HttpRequestException encountered.\n An error occurred while sending the request.\r\nbash: /dev/tty: No such device or address\nerror: failed to execute prompt script (exit code 1)\nfatal: could not read Username for \'https://github.com\': No error\n',
name: 'ProcessError' }
The error is because of incorrect proxy settings.
So, if you have proxy you have to add it to the git config or environment variables.
set HTTPS_PROXY=http://<login>:<password>#proxy:port
set HTTP_PROXY=http://<login>:<password>#proxy:port
set NO_PROXY=localhost,my.company
Note the NO_PROXY, to allow to access internal site to your company
You also can register that in your git config:
git config --global http.proxy http://<login>:<password>#proxy:port
OR, if you don't have proxy you can try to unset the proxy settings
git config --global --unset http.proxy
https version:
git config --global --unset https.proxy
In circle-ci 1.0 the config file seemed to specify dependencies. I noticed that in circle-ci 2.0 that this concept is gone to some degree.
Sooo I tried the following:
steps:
- checkout
- run:
name: Install Sauce Connect
command: |
wget https://saucelabs.com/downloads/sc-latest-linux.tar.gz
tar -xzf sc-latest-linux.tar.gz
...
- run: yarn integration
Seems like this didn't quite pan out. I get the following result in circle-ci's console:
#!/bin/bash -eo pipefail
yarn run integration
yarn run v0.24.6
$ node_modules/.bin/wdio test/wdio.conf.js
A service failed in the 'onPrepare' hook
Error: Could not start Sauce Connect. Exit code 1 signal: null
at ChildProcess.<anonymous> (/home/circleci/repo/node_modules/sauce-connect-launcher/lib/sauce-connect-launcher.js:559:12)
at emitTwo (events.js:125:13)
at ChildProcess.emit (events.js:213:7)
at Process.ChildProcess._handle.onexit (internal/child_process.js:197:12)
Continue...
ERROR: connect ECONNREFUSED 127.0.0.1:4445
chrome
Error
ERROR: connect ECONNREFUSED 127.0.0.1:4445
chrome
Error
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Exited with code 1
I'm using wdio, with the sauce and mocha plugins. It works locally. Ideas? Any guides that exist anywhere for this? Google didn't produce any answers for circle-ci 2.0 and saucelabs integrations.