Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to build in a dev environment without publishing credentials #2670

Closed
IGassmann opened this issue Mar 6, 2018 · 11 comments · Fixed by EHDFE/ehdev-shell#205 or Thorium-Sim/thorium-kiosk#40 · May be fixed by qcif/data-curator#563
Labels

Comments

@IGassmann
Copy link

  • Version: 19.56.0
  • Target: macOS

The command $ electron-builder build fails on a development environment because we are not providing AWS publishing credentials on local environments.

The error being thrown is CredentialsError: Missing credentials in config.

Is there any way to build/package the app locally just for testing purposes without having to provide publishing credentials?

@develar
Copy link
Member

develar commented Mar 7, 2018

Publish is not performed automatically on local machine, only if CI detected. Maybe you pass --publish always?

@IGassmann
Copy link
Author

@develar I've tried running the command with -p never and it still throws the credential error.

@develar
Copy link
Member

develar commented Mar 7, 2018

Please set env DEBUG=electron-builder and attach log of the terminal output.

@IGassmann
Copy link
Author

Here it is:

$ env DEBUG=electron-builder yarn electron-builder build -p never
yarn run v1.3.2
$ /Users/IGassmann/Developer/LBRY/lbry-app/node_modules/.bin/electron-builder build -p never
  • electron-builder version=19.56.0
  • loaded configuration file=/Users/IGassmann/Developer/LBRY/lbry-app/electron-builder.json
  • loaded parent configuration file=/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-webpack/electron-builder.yml
  • effective config config=
                       directories:
                         output: dist
                         buildResources: build
                       extraMetadata:
                         main: main.js
                       files:
                         - from: .
                           filter:
                             - package.json
                         - from: dist/main
                         - from: dist/renderer
                         - from: dist/renderer-dll
                       extraResources:
                         - from: static
                           to: static
                       appId: io.lbry.LBRY
                       productName: LBRY
                       publish:
                         - provider: s3
                           bucket: releases.lbry.io
                           path: app/latest
                         - github
                       mac:
                         target: dmg
                         category: public.app-category.entertainment
                       dmg:
                         iconSize: 128
                         contents:
                           - x: 115
                             'y': 164
                           - x: 387
                             'y': 164
                             type: link
                             path: /Applications
                         window:
                           x: 200
                           'y': 200
                           width: 500
                           height: 300
                         background: ./build/background.png
                       protocols:
                         - name: LBRY URI
                           schemes:
                             - lbry
                           role: Viewer
                       linux:
                         category: AudioVideo;Video
                         desktop:
                           MimeType: x-scheme-handler/lbry;
                       nsis:
                         perMachine: true
                       artifactName: '${productName}_${version}.${ext}'
                       extends: electron-webpack/electron-builder.yml

  • writing effective config file=dist/electron-builder.yaml
  • Unresolved dependencies after first round unresolved=7zip-bin-win, 7zip-bin-linux
  • rebuilding native production dependencies platform=darwin arch=x64
  • rebuilding native dependency name=keytar-prebuild
  • spawning        command=/Users/IGassmann/.nvm/versions/node/v8.9.0/bin/node args=/Users/IGassmann/.yarn/bin/yarn.js run install cwd=/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/keytar-prebuild
$ prebuild-install || node-gyp rebuild
prebuild-install info begin Prebuild-install version 2.5.0
prebuild-install info looking for local prebuild @ prebuilds/keytar-prebuild-v4.1.1-electron-v54-darwin-x64.tar.gz
prebuild-install info looking for cached prebuild @ /Users/IGassmann/.npm/_prebuilds/https-github.com-electron-userland-electron-builder-binaries-releases-download-v4.1.1-keytar-prebuild-v4.1.1-electron-v54-darwin-x64.tar.gz
prebuild-install info found cached prebuild
prebuild-install info unpacking @ /Users/IGassmann/.npm/_prebuilds/https-github.com-electron-userland-electron-builder-binaries-releases-download-v4.1.1-keytar-prebuild-v4.1.1-electron-v54-darwin-x64.tar.gz
prebuild-install info unpack resolved to /Users/IGassmann/Developer/LBRY/lbry-app/node_modules/keytar-prebuild/build/Release/keytar.node
prebuild-install info install Successfully installed prebuilt binary!
  • exited          command=node code=0 pid=48661
  • packaging       platform=darwin arch=x64 electron=1.7.11 appOutDir=dist/mac
  • executing       file=unzip args=-oqq -d /Users/IGassmann/Developer/LBRY/lbry-app/dist/mac /Users/IGassmann/Library/Caches/electron/electron-v1.7.11-darwin-x64.zip
  • executed        file=unzip
  • skipped copying directory=/Users/IGassmann/Developer/LBRY/lbry-app/dist/renderer-dll reason=doesn't exist
  • not packed into asar archive file=node_modules/7zip-bin-mac/7za reason=contains executable code
  • not packed into asar archive file=node_modules/npm/node_modules/update-notifier/node_modules/boxen/node_modules/term-size/vendor/resize reason=contains executable code
  • found existing  path=/Users/IGassmann/Library/Caches/electron-builder/app-builder/app-builder-v0.6.1-x64
  • executing       file=/Users/IGassmann/Library/Caches/electron-builder/app-builder/app-builder-v0.6.1-x64/app-builder args=icon --format icns --root /Users/IGassmann/Developer/LBRY/lbry-app/build --root /Users/IGassmann/Developer/LBRY/lbry-app --input /Users/IGassmann/Developer/LBRY/lbry-app/build/icon.icns cwd=/Users/IGassmann/Developer/LBRY/lbry-app env=
                      {
                        "TMPDIR": "/private/var/folders/7q/kylwp7_d5g3559lrwpds96j80000gn/T/temp-dir-yEufBA",
                        "DEBUG": "true"
                      }
  • executed        file=/Users/IGassmann/Library/Caches/electron-builder/app-builder/app-builder-v0.6.1-x64/app-builder stdout={"icons":[{"file":"/Users/IGassmann/Developer/LBRY/lbry-app/build/icon.icns","size":0}]}
  • copying files using pattern matcher=from: /Users/IGassmann/Developer/LBRY/lbry-app/static, to: /Users/IGassmann/Developer/LBRY/lbry-app/dist/mac/LBRY.app/Contents/Resources/static, patterns: **/*
  • copying         src=/Users/IGassmann/Developer/LBRY/lbry-app/static destination=/Users/IGassmann/Developer/LBRY/lbry-app/dist/mac/LBRY.app/Contents/Resources/static
  • calling getInfo reason=owner or project is not specified explicitly provider=github owner=undefined project=undefined
CredentialsError: Missing credentials in config
    at ClientRequest.<anonymous> (/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/aws-sdk/lib/http/node.js:83:34)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:106:13)
    at ClientRequest.emit (events.js:208:7)
    at Socket.emitTimeout (_http_client.js:708:34)
    at Object.onceWrapper (events.js:313:30)
    at emitNone (events.js:106:13)
    at Socket.emit (events.js:208:7)
    at Socket._onTimeout (net.js:407:8)
    at ontimeout (timers.js:475:11)
    at tryOnTimeout (timers.js:310:5)
    at Timer.listOnTimeout (timers.js:270:5)
From previous event:
    at Function.checkAndResolveOptions (/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-publisher-s3/out/s3Publisher.js:53:11)
    at /Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder-lib/src/publish/PublishManager.ts:398:25
    at Generator.next (<anonymous>)
From previous event:
    at getResolvedPublishConfig (/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder-lib/out/publish/PublishManager.js:206:22)
    at /Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder-lib/src/publish/PublishManager.ts:347:64
    at runCallback (timers.js:789:20)
    at tryOnImmediate (timers.js:751:5)
    at processImmediate [as _immediateCallback] (timers.js:722:5)
From previous event:
    at /Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder-lib/src/publish/PublishManager.ts:347:33
    at Generator.next (<anonymous>)
From previous event:
    at getPublishConfigs (/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder-lib/out/publish/PublishManager.js:117:22)
    at /Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder-lib/src/publish/PublishManager.ts:192:79
    at Generator.next (<anonymous>)
From previous event:
    at getAppUpdatePublishConfiguration (/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder-lib/out/publish/PublishManager.js:40:22)
    at /Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder-lib/src/publish/PublishManager.ts:87:35
    at Generator.next (<anonymous>)
From previous event:
    at PublishManager.packager.addAfterPackHandler (/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder-lib/out/publish/PublishManager.js:353:29)
    at default.each.it (/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder-lib/src/packager.ts:458:49)
From previous event:
    at Packager.afterPack (/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder-lib/src/packager.ts:458:28)
    at /Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder-lib/src/platformPackager.ts:212:21
    at Generator.next (<anonymous>)
    at runCallback (timers.js:789:20)
    at tryOnImmediate (timers.js:751:5)
    at processImmediate [as _immediateCallback] (timers.js:722:5)
From previous event:
    at MacPackager.doPack (/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder-lib/out/platformPackager.js:284:11)
    at /Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder-lib/src/macPackager.ts:90:63
    at Generator.next (<anonymous>)
From previous event:
    at MacPackager.pack (/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder-lib/out/macPackager.js:200:11)
    at /Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder-lib/src/packager.ts:364:24
    at Generator.next (<anonymous>)
    at xfs.stat (/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/fs-extra-p/node_modules/fs-extra/lib/mkdirs/mkdirs.js:56:16)
    at /Users/IGassmann/Developer/LBRY/lbry-app/node_modules/graceful-fs/polyfills.js:287:18
    at FSReqWrap.oncomplete (fs.js:153:5)
From previous event:
    at Packager.doBuild (/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder-lib/out/packager.js:432:11)
    at /Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder-lib/src/packager.ts:308:52
    at Generator.next (<anonymous>)
    at /Users/IGassmann/Developer/LBRY/lbry-app/node_modules/graceful-fs/graceful-fs.js:99:16
    at /Users/IGassmann/Developer/LBRY/lbry-app/node_modules/graceful-fs/graceful-fs.js:43:10
    at FSReqWrap.oncomplete (fs.js:135:15)
From previous event:
    at Packager._build (/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder-lib/out/packager.js:376:11)
    at /Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder-lib/src/packager.ts:270:23
    at Generator.next (<anonymous>)
    at runCallback (timers.js:789:20)
    at tryOnImmediate (timers.js:751:5)
    at processImmediate [as _immediateCallback] (timers.js:722:5)
From previous event:
    at Packager.build (/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder-lib/out/packager.js:332:11)
    at /Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder/src/builder.ts:310:40
    at Generator.next (<anonymous>)
From previous event:
    at _build (/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder/out/builder.js:61:21)
    at build (/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder/src/builder.ts:280:10)
    at then (/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder/src/cli/cli.ts:48:33)
    at runCallback (timers.js:789:20)
    at tryOnImmediate (timers.js:751:5)
    at processImmediate [as _immediateCallback] (timers.js:722:5)
From previous event:
    at Object.args [as handler] (/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder/src/cli/cli.ts:48:33)
    at Object.runCommand (/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder/node_modules/yargs/lib/command.js:235:44)
    at Object.parseArgs [as _parseArgs] (/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder/node_modules/yargs/yargs.js:1014:30)
    at Object.get [as argv] (/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder/node_modules/yargs/yargs.js:957:21)
    at Object.<anonymous> (/Users/IGassmann/Developer/LBRY/lbry-app/node_modules/electron-builder/src/cli/cli.ts:42:15)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)
    at Function.Module.runMain (module.js:676:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
✨  Done in 21.45s.

@cweekly
Copy link

cweekly commented Mar 9, 2018

Hi Igor, I just ran into something similar and resorted (for now) to setting

publish:
  provider: "generic"
  url: "https://www.example.com" 

as a temp workaround. HTH.

@IGassmann
Copy link
Author

IGassmann commented Mar 9, 2018

@cweekly thanks for your message. Unfortunately, this is not an option for us. Our publishing is being done through electron-builder.

@IGassmann
Copy link
Author

@develar It seems like the problem is that publishing is being triggered for whatever reason. I don't understand why since I'm not on a tagged commit and neither on CI. What could be triggering a publishing other than those reasons or by using yarn release?

@develar develar added bug and removed reply-needed labels Mar 9, 2018
@develar
Copy link
Member

develar commented Mar 9, 2018

Bug. Will be fixed evening CET. Thanks for log.

@develar
Copy link
Member

develar commented Mar 10, 2018

We need to compute final effective publish configuration for update info files, because we generate it ALWAYS. Why always? Because some users don't use our publisher and give a freedom.

Why S3 needs AWS credentials to compute effective configuration? Because S3 bucket URL depends on bucket on region (don't ask why :()

@develar
Copy link
Member

develar commented Mar 10, 2018

So, will be allowed to build without AWS credentials, but, obviously, app-update.yml in the app resources will be not always correct. As you need it for dev builds, it is ok.

@develar
Copy link
Member

develar commented Mar 10, 2018

yeach... your bucket name is dotted — releases.lbry.io

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment