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

Cannot publish to S3 #143

Closed
3 tasks done
noahott opened this issue Feb 22, 2017 · 17 comments
Closed
3 tasks done

Cannot publish to S3 #143

noahott opened this issue Feb 22, 2017 · 17 comments

Comments

@noahott
Copy link

noahott commented Feb 22, 2017

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Please describe your issue:

I cannot publish to an S3 target. Publish failing with error: Could not find a publish target with the name: true
I've tried the publish command with and without an explicit --target flag and with various formatting. Leaving off the flag defaults to github which I don't have setup or defined in the config JSON. I get the same error every time.

Console output when you run electron-forge with the environment variable DEBUG=electron-forge:*. (Instructions on how to do so here). Please include the stack trace if one exists.

WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:lifecycle Process Started: Checking your system +0ms
  electron-forge:lifecycle Process Succeeded: Checking your system +47ms
  electron-forge:runtime-config setting key: verbose to value: false +9ms
WARNING: DEBUG environment variable detected.  Progress indicators will be sent over electron-forge:lifecycle
  electron-forge:lifecycle Process Started: Resolving Forge Config +0ms
  electron-forge:project-resolver searching for project in: /Users/noah/test-project +3ms
  electron-forge:project-resolver electron-forge compatible package.json found in /Users/noah/test-project/package.json +10ms
  electron-forge:lifecycle Process Succeeded: Resolving Forge Config +9ms
We need to package your application before we can make it
  electron-forge:lifecycle Process Started: Preparing to Package Application for arch: x64 +2ms
  electron-forge:project-resolver searching for project in: /Users/noah/test-project +0ms
  electron-forge:project-resolver electron-forge compatible package.json found in /Users/noah/test-project/package.json +1ms
  electron-forge:packager packaging with options { asar: false,
  overwrite: true,
  afterCopy: [ [Function], [Function], [Function] ],
  afterExtract: [],
  dir: '/Users/noah/test-project',
  arch: 'x64',
  platform: 'darwin',
  out: '/Users/noah/test-project/out',
  electronVersion: '1.4.15',
  quiet: true } +4ms
  electron-forge:lifecycle Process Succeeded: Preparing to Package Application for arch: x64 +17s
  electron-forge:lifecycle Process Started: Compiling Application +3ms
  electron-forge:lifecycle Process Succeeded: Compiling Application +1s
  electron-forge:lifecycle Process Started: Preparing native dependencies +2ms
  electron-forge:lifecycle Process Succeeded: Preparing native dependencies +127ms
  electron-forge:lifecycle Process Started: Packaging Application +1ms
  electron-forge:lifecycle Process Succeeded: Packaging Application +10s
Making for the following targets:
  electron-forge:lifecycle Process Started: Making for target: zip - On platform: darwin - For arch: x64 +5ms
  electron-forge:require-search searching [ '../makers/darwin/zip.js',
  '../makers/generic/zip.js',
  'electron-forge-maker-zip',
  '/usr/local/lib/node_modules/electron-forge/dist/makers/darwin/zip.js',
  '/usr/local/lib/node_modules/electron-forge/dist/makers/generic/zip.js',
  '/usr/local/lib/node_modules/electron-forge/dist/api/electron-forge-maker-zip',
  '/usr/local/lib/node_modules/electron-forge/dist/api/makers/darwin/zip.js',
  '/usr/local/lib/node_modules/electron-forge/dist/api/makers/generic/zip.js',
  '/usr/local/lib/node_modules/electron-forge/dist/api/node_modules/electron-forge-maker-zip' ] relative to /usr/local/lib/node_modules/electron-forge/dist/api +1ms
  electron-forge:require-search testing ../makers/darwin/zip.js +3ms
  electron-forge:require-search testing ../makers/generic/zip.js +0ms
  electron-forge:lifecycle Process Succeeded: Making for target: zip - On platform: darwin - For arch: x64 +12s
  electron-forge:project-resolver searching for project in: /Users/noah/test-project +2ms
  electron-forge:project-resolver electron-forge compatible package.json found in /Users/noah/test-project/package.json +1ms
  electron-forge:lifecycle Process Started: Resolving publish target: true +8ms
  electron-forge:require-search searching [ '../publishers/true.js',
  'electron-forge-publisher-true',
  '/usr/local/lib/node_modules/electron-forge/dist/publishers/true.js',
  '/usr/local/lib/node_modules/electron-forge/dist/api/electron-forge-publisher-true',
  '/usr/local/lib/node_modules/electron-forge/dist/api/publishers/true.js',
  '/usr/local/lib/node_modules/electron-forge/dist/api/node_modules/electron-forge-publisher-true' ] relative to /usr/local/lib/node_modules/electron-forge/dist/api +1ms
  electron-forge:require-search testing ../publishers/true.js +0ms
  electron-forge:require-search testing electron-forge-publisher-true +1ms
  electron-forge:require-search testing /usr/local/lib/node_modules/electron-forge/dist/publishers/true.js +0ms
  electron-forge:require-search testing /usr/local/lib/node_modules/electron-forge/dist/api/electron-forge-publisher-true +0ms
  electron-forge:require-search testing /usr/local/lib/node_modules/electron-forge/dist/api/publishers/true.js +0ms
  electron-forge:require-search testing /usr/local/lib/node_modules/electron-forge/dist/api/node_modules/electron-forge-publisher-true +0ms
  electron-forge:require-search failed to find a module in [ '../publishers/true.js',
  'electron-forge-publisher-true',
  '/usr/local/lib/node_modules/electron-forge/dist/publishers/true.js',
  '/usr/local/lib/node_modules/electron-forge/dist/api/electron-forge-publisher-true',
  '/usr/local/lib/node_modules/electron-forge/dist/api/publishers/true.js',
  '/usr/local/lib/node_modules/electron-forge/dist/api/node_modules/electron-forge-publisher-true' ] +1ms
  electron-forge:lifecycle Process Failed: Resolving publish target: true +3ms

Electron forge was terminated:
Could not find a publish target with the name: true

What command line arguments are you passing?

electron-forge publish --target=s3
electron-forge publish --target s3
electron-forge publish --target="s3"

What does your config.forge data in package.json look like?

{
      "make_targets": {
        "win32": [
          "squirrel"
        ],
        "darwin": [
          "zip"
        ],
        "linux": [
          "deb",
          "rpm"
        ]
      },
      "electronPackagerConfig": {},
      "electronWinstallerConfig": {
        "name": "test_project"
      },
      "electronInstallerDebian": {},
      "electronInstallerRedhat": {},
      "windowsStoreConfig": {
        "packageName": "",
        "name": "testproject"
      },
      "publish_targets": {
        "s3": {
          "accessKey": "AKIAIZQRPHMZZYTGK6NQ",
          "bucket": "mq-apps",
          "folder": "Releases",
          "public": true
        }
      },
      "s3": {
        "accessKey": "AKIAIZQRPHMZZYTGK6NQ",
        "bucket": "mq-apps",
        "folder": "Releases",
        "public": true
      }
    }

Please provide either a failing minimal testcase (with a link to the code) or detailed steps to
reproduce your problem. Using electron-forge init is a good starting point, if that is not the
source of your problem.

$ electron-forge init

remove github_repository object and add in to forge config:

"publish_targets": {
"s3": {
"accessKey": "XXXX",
"bucket": "XXXX",
"folder": "Releases",
"public": true
}
},
"s3": {
"accessKey": "XXXX",
"bucket": "XXXX",
"folder": "Releases",
"public": true
}

$ electron-forge publish --target=s3

@MarshallOfSound
Copy link
Member

@noahott You're config object is a little bit off I think

{
  "make_targets": {
    "win32": [
      "squirrel"
    ],
    "darwin": [
      "zip"
    ],
    "linux": [
      "deb",
      "rpm"
    ]
  },
  "electronPackagerConfig": {},
  "electronWinstallerConfig": {
    "name": "test_project"
  },
  "electronInstallerDebian": {},
  "electronInstallerRedhat": {},
  "windowsStoreConfig": {
    "packageName": "",
    "name": "testproject"
  },
  "publish_targets": {
    "linux": ["s3"],
    "darwin" ["s3"],
    "win32": ["s3"],
  },
  "s3": {
    "accessKey": "AKIAIZQRPHMZZYTGK6NQ",
    "bucket": "mq-apps",
    "folder": "Releases",
    "public": true
  }
}

Then simply run electron-forge publish

@noahott
Copy link
Author

noahott commented Feb 23, 2017

I've updated the config as you suggested, but I am still getting the same errors. Running "electron-forge publish" tries to publish to github and fails with an error that the owner and name properties are not defined. Running "electron-forge publish --target=s3" results in the same error "Could not find a publish target with the name: true"

@MarshallOfSound
Copy link
Member

@noahott What is your electron forge version?

electron-forge --version

@noahott
Copy link
Author

noahott commented Feb 23, 2017

@MarshallOfSound it is 2.8.0. I installed through npm

@MarshallOfSound
Copy link
Member

MarshallOfSound commented Feb 23, 2017

Oh, this hasn't been released yet

8572cad

@MarshallOfSound
Copy link
Member

@noahott Just published 2.8.1, can you try that out please 👍

@noahott
Copy link
Author

noahott commented Feb 23, 2017

I updated to 2.8.1, but now i'm running into a different error during the "preparing native dependencies" stage:

An unhandled error has occurred inside Forge: Could locate node-gyp Error: Could locate node-gyp at _callee6$ (/usr/local/lib/node_modules/electron-forge/node_modules/electron-rebuild/lib/rebuild.js:164:19) at tryCatch (/usr/local/lib/node_modules/electron-forge/node_modules/electron-rebuild/node_modules/regenerator-runtime/runtime.js:63:40) at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/electron-forge/node_modules/electron-rebuild/node_modules/regenerator-runtime/runtime.js:337:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/electron-forge/node_modules/electron-rebuild/node_modules/regenerator-runtime/runtime.js:96:21) at GeneratorFunctionPrototype.tryCatcher (/usr/local/lib/node_modules/electron-forge/node_modules/bluebird/js/release/util.js:16:23) at PromiseSpawn._promiseFulfilled (/usr/local/lib/node_modules/electron-forge/node_modules/bluebird/js/release/generators.js:97:49) at Promise._settlePromise (/usr/local/lib/node_modules/electron-forge/node_modules/bluebird/js/release/promise.js:572:26) at Promise._settlePromise0 (/usr/local/lib/node_modules/electron-forge/node_modules/bluebird/js/release/promise.js:612:10) at Promise._settlePromises (/usr/local/lib/node_modules/electron-forge/node_modules/bluebird/js/release/promise.js:691:18) at Async._drainQueue (/usr/local/lib/node_modules/electron-forge/node_modules/bluebird/js/release/async.js:133:16) at Async._drainQueues (/usr/local/lib/node_modules/electron-forge/node_modules/bluebird/js/release/async.js:143:10) at Immediate.Async.drainQueues (/usr/local/lib/node_modules/electron-forge/node_modules/bluebird/js/release/async.js:17:14) at runCallback (timers.js:637:20) at tryOnImmediate (timers.js:610:5) at processImmediate [as _immediateCallback] (timers.js:582:5)

not sure if this is related, but I can't test publishing now without getting this.

@malept
Copy link
Member

malept commented Feb 23, 2017

It's unrelated and a very strange error.

@malept
Copy link
Member

malept commented Feb 23, 2017

I can't reproduce the node-gyp error on Linux (64-bit) on a project with a native module.

@noahott
Copy link
Author

noahott commented Feb 23, 2017

I was able to solve the node-gyp related error by uninstalling electron-forge and reinstalling using npm.

I was able to get publishing setup to S3 with a few caveats. Publishing fails with the folowing error when only the ELECTRON_FORGE_S3_SECRET_ACCESS_KEY environment variable is set:

Electron forge was terminated: In order to publish to s3 you must set the "s3.accessKeyId", "process.env.ELECTRON_FORGE_S3_SECRET_ACCESS_KEY" and "s3.bucket" properties in your forge config. See the docs for more info

Publishing only succeeds when BOTH the "secretAccessKey" and "secret" properties are defined in the forge.s3 config. This is not documented anywhere, and doesn't match the instructions in the error message.

@malept
Copy link
Member

malept commented Feb 23, 2017

That's strange, because there's no reference to a secret property in the code.

@noahott
Copy link
Author

noahott commented Feb 23, 2017

@malept
Copy link
Member

malept commented Feb 23, 2017

  1. Stupid GitHub search, why didn't it find that??
  2. Looks like a typo 😢

@gitsome
Copy link

gitsome commented Aug 3, 2019

I noticed that using Electron 6 that uses Node.js v12 has a conflict with [email protected]. The S3 publisher has a dependency on "s3" which uses [email protected]. The master branch of the "s3" module has a reference to the version of graceful-fs that works, but they have not published the fix to NPM. Issue: andrewrk/node-s3-client#197

@MarshallOfSound
Copy link
Member

@gitsome The version of node that Electron uses is entirely unrelated to the version of node you have on your system (and run electron-forge with). They don't need to match in any way

@gitsome
Copy link

gitsome commented Aug 4, 2019

@gitsome The version of node that Electron uses is entirely unrelated to the version of node you have on your system (and run electron-forge with). They don't need to match in any way

Thanks for the response @MarshallOfSound! That's a good point. I could switch versions during publish and avoid the error. I do have nodegit as a dependency in my Electron project though and am trying to build it while on NodeJS 12 in my local system. I'll try to downgrade to NodeJS 10 and see if I can get both nodegit to build succesfully and also avoid the s3 publish issue. Thanks for all your great work!

@malept
Copy link
Member

malept commented Dec 18, 2019

Electron Forge v6 no longer uses the s3 node module, it uses aws-sdk directly.

dsanders11 pushed a commit that referenced this issue Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants