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

Electron-forge flatpak maker exits with status code 1 #1792

Closed
trusktr opened this issue Jun 25, 2020 · 6 comments
Closed

Electron-forge flatpak maker exits with status code 1 #1792

trusktr opened this issue Jun 25, 2020 · 6 comments
Labels

Comments

@trusktr
Copy link

trusktr commented Jun 25, 2020

When I try to run electron-forge make with @electron-forge/maker-flatpak, it fails with an error:

An unhandled error has occurred inside Forge:
An error occured while making for target: flatpak
flatpak failed with status code 1
Error: flatpak failed with status code 1
    at ChildProcess.<anonymous> (/home/trusktr/src/foo+bar/node_modules/@malept/flatpak-bundler/index.js:71:16)
    at ChildProcess.emit (events.js:315:20)
    at ChildProcess.EventEmitter.emit (domain.js:485:12)
    at maybeClose (internal/child_process.js:1051:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5)

This is my electron-forge config:

module.exports = {
  packagerConfig: {},
  makers: [ {name: '@electron-forge/maker-flatpak'} ],
}

Any ideas?

EDIT: I suppose I would need to debug the flatpak-bundler code on that line 71. cc @malept. Have you had any exit code 1 with flatpak?

@malept
Copy link
Member

malept commented Jun 28, 2020

(For the record, this is not an enhancement.)

This should be fixed in 6.0.0-beta.52 (#1703). If upgrading Forge doesn't work, I need more information via setting the DEBUG environment variable to electron-installer-flatpak,@malept/flatpak-bundler and posting the output here (preferably via a gist or <details> element)

@malept malept closed this as completed Jun 28, 2020
@linonetwo
Copy link

linonetwo commented Apr 3, 2022

Same here 

    {
      name: '@electron-forge/maker-flatpak',
      config: {
        options: {
          categories: ['Productivity'],
        },
      },
    },
 ✖ Making for target: flatpak - On platform: linux - For arch: x64

        An unhandled error has occurred inside Forge:
        An error occured while making for target: flatpak
        flatpak failed with status code 1
        Error: flatpak failed with status code 1
            at ChildProcess.<anonymous> (/home/runner/work/TidGi-Desktop/TidGi-Desktop/node_modules/@malept/flatpak-bundler/index.js:71:16)
            at ChildProcess.emit (events.js:400:28)
            at ChildProcess.emit (domain.js:475:12)
            at maybeClose (internal/child_process.js:1058:16)
            at Process.ChildProcess._handle.onexit (internal/child_process.js:293:5)

with no helpful error message.

@felipecrs
Copy link

DEBUG doesn't help:

DEBUG=1 npm run make

> [email protected] make
> electron-vite build && electron-forge make

renderer and preload config is missing
vite v5.2.8 building SSR bundle for production...
✓ 4 modules transformed.
dist/main/index.js  28.82 kB
✓ built in 126ms
✔ Checking your system
[STARTED] Loading configuration
[SUCCESS] Loading configuration
[STARTED] Resolving make targets
[DATA] Making for the following targets:
[SUCCESS] Resolving make targets
[STARTED] Running package command
[STARTED] Preparing to package application
[SUCCESS] Preparing to package application
[STARTED] Running packaging hooks
[STARTED] Running generateAssets hook
[SUCCESS] Running generateAssets hook
[STARTED] Running prePackage hook
[SUCCESS] Running prePackage hook
[SUCCESS] Running packaging hooks
[STARTED] Packaging application
[DATA] Determining targets...
[STARTED] Packaging for x64 on linux
[STARTED] Copying files
[SUCCESS] Copying files
[STARTED] Preparing native dependencies
[TITLE] Preparing native dependencies
[SUCCESS] Preparing native dependencies
[STARTED] Finalizing package
[SUCCESS] Finalizing package
[SUCCESS] Packaging for x64 on linux
[SUCCESS] Packaging application
[STARTED] Running postPackage hook
[SUCCESS] Running postPackage hook
[SUCCESS] Running package command
[STARTED] Running preMake hook
[SUCCESS] Running preMake hook
[STARTED] Making distributables
[STARTED] Making a flatpak distributable for linux/x64
[FAILED] flatpak failed with status code 1
[FAILED] flatpak failed with status code 1

An unhandled rejection has occurred inside Forge:
Error: flatpak failed with status code 1
at ChildProcess.<anonymous> (/home/felipecrs/repos/clipboard-sync/node_modules/@malept/flatpak-bundler/index.js:71:16)
    at ChildProcess.emit (node:events:518:28)
    at ChildProcess.emit (node:domain:488:12)
    at maybeClose (node:internal/child_process:1105:16)
    at ChildProcess._handle.onexit (node:internal/child_process:305:5)

@felipecrs
Copy link

felipecrs commented Apr 9, 2024

Tweaking the code a bit I found out it's failing when running:

flatpak install --user --no-deps --arch x86_64 --assumeyes runtime/org.freedesktop.Platform/x86_64/19.08

Running the command on my own:

Looking for matches…
error: No remote refs found similar to ‘runtime/org.freedesktop.Platform/x86_64/19.08’

The issue was resolved by running:

flatpak --user remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

Note the --user. Now maker-flatpak works fine.

You may also need:

git config --global protocol.file.allow always

PS: I'm on Ubuntu 22.04 on WSL2.

@bennyzen
Copy link

bennyzen commented Oct 7, 2024

Unfortunately, the above provided fix does not work on Arch or Manjaro. Any further ideas/suggestions?

@linonetwo
Copy link

Why closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants