NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.28k stars 13.53k forks source link

firefoxpwa : No such file or directory (os error 2) #302431

Closed Thatoo closed 4 months ago

Thatoo commented 5 months ago

Describe the bug

After installing firefoxpwa and installing one PWA, when I try to launch it, I get this error : No such file or directory (os error 2)

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install firefoxpwa this way in /etc/nixos/configuration.nix :
    
    { config, pkgs, lib, inputs, ... }:

{ environment.systemPackages = with pkgs; [ inputs.nixpkgs_unstable.legacyPackages."${pkgs.system}".firefoxpwa ]; programs.firefox = { enable = true; package = pkgs.firefox; nativeMessagingHosts.packages = with pkgs; [ browserpass inputs.nixpkgs_unstable.legacyPackages."${pkgs.system}".firefoxpwa ]; };

2. Install firefox extension https://addons.mozilla.org/fr/firefox/addon/pwas-for-firefox/
3. be sure this folder exists : ~/.local/share/icons/hicolor/ to solve this issue : https://github.com/NixOS/nixpkgs/issues/301194
4. Install a PWA
5. Launch the PWA
6. Get the following error : `No such file or directory (os error 2)`

### Expected behavior
The PWA should launch

### Screenshots
![image](https://github.com/NixOS/nixpkgs/assets/464782/b5f29a22-71ba-4f53-b9e2-8d6108b10b3a)

### Additional context
flake.nix file : 

{ description = "Thatoo's flake";

inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; nixpkgs_unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; };

outputs = inputs@{ self, nixpkgs, ... }: {

nixosConfigurations.default = nixpkgs.lib.nixosSystem {
  system = "x86_64-linux";
  specialArgs = { inherit inputs; };
  modules = [
    ./configuration.nix
  ];
};

}; }


### Notify maintainers

@camillemndn
@pasqui23

### Metadata

```console
[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.84, NixOS, 23.11 (Tapir), 23.11.20240406.e38d7cb`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"nixos-23.11, nixos-unstable"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Add a :+1: reaction to issues you find important.

Thatoo commented 5 months ago

In case it helps, here is the structure of the PWA profile :

image

filips123 commented 4 months ago

Can you please check the native logs as described here?

Thatoo commented 4 months ago

firefoxpwa.log :

Caused by:
    No such file or directory (os error 2)
08:18:35 [INFO] Connection established: ["/nix/store/qdi0ykbv8qbnb9mk5aqjr0218g6d63vw-firefoxpwa-2.11.1/bin/firefoxpwa-connector", "/nix/store/6mi9apwyql6sirwsccgqv23avw5aqpwd-firefox-124.0.2/lib/mozilla/native-messaging-hosts/firefoxpwa.json", "firefoxpwa@filips.si"]
08:18:35 [INFO] Received a request: GetSystemVersions(GetSystemVersions)
08:18:35 [INFO] Processed the request: SystemVersions { firefoxpwa: Some("2.11.1"), firefox: Some("113.0.2"), _7zip: None }
08:18:35 [INFO] Sent a response
08:18:35 [INFO] Connection established: ["/nix/store/qdi0ykbv8qbnb9mk5aqjr0218g6d63vw-firefoxpwa-2.11.1/bin/firefoxpwa-connector", "/nix/store/6mi9apwyql6sirwsccgqv23avw5aqpwd-firefox-124.0.2/lib/mozilla/native-messaging-hosts/firefoxpwa.json", "firefoxpwa@filips.si"]
08:18:35 [INFO] Received a request: GetProfileList(GetProfileList)
08:18:35 [INFO] Processed the request: ProfileList({Ulid(0): Profile { ulid: Ulid(0), name: Some("Default"), description: Some("Default profile for all web apps"), sites: [] }, Ulid(2070313890124831775813507290021981675): Profile { ulid: Ulid(2070313890124831775813507290021981675), name: Some("Netxcloud"), description: None, sites: [Ulid(2070313890796545773615676478447194990)] }})
08:18:35 [INFO] Sent a response
08:18:35 [INFO] Connection established: ["/nix/store/qdi0ykbv8qbnb9mk5aqjr0218g6d63vw-firefoxpwa-2.11.1/bin/firefoxpwa-connector", "/nix/store/6mi9apwyql6sirwsccgqv23avw5aqpwd-firefox-124.0.2/lib/mozilla/native-messaging-hosts/firefoxpwa.json", "firefoxpwa@filips.si"]
08:18:35 [INFO] Received a request: GetSiteList(GetSiteList)
08:18:35 [INFO] Processed the request: SiteList({Ulid(2070313890796545773615676478447194990): Site { ulid: Ulid(2070313890796545773615676478447194990), profile: Ulid(2070313890124831775813507290021981675), config: SiteConfig { name: Some("Netxcloud"), description: Some("Boîte à outils en ligne"), start_url: None, icon_url: None, document_url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("DOMAINE.NAME")), port: None, path: "/apps/files/files", query: None, fragment: None }, manifest_url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("DOMAINE.NAME")), port: None, path: "/apps/theming/manifest/files", query: Some("v=1c631757"), fragment: None }, categories: Some(["office", "calendar", "email", "presentation", "spreadsheet", "file-transfer", "remote-access", "productivity"]), keywords: None, enabled_url_handlers: [], enabled_protocol_handlers: [], custom_protocol_handlers: [], launch_on_login: false, launch_on_browser: false }, manifest: WebAppManifest { start_url: Absolute(Url { schem

Nothing in the other two files
e: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("DOMAINE.NAME")), port: None, path: "/apps/files/", query: None, fragment: None }), scope: Absolute(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("DOMAINE.NAME")), port: None, path: "/apps/files/", query: None, fragment: None }), name: Some("Files - Nextcloud"), short_name: Some("Files"), description: Some("File Management"), categories: [], keywords: [], dir: Auto, lang: None, display: Standalone, orientation: Any, background_color: Some(Color { r: 0.8784313725490196, g: 0.0, b: 0.30196078431372547, a: 1.0 }), theme_color: Some(Color { r: 0.8784313725490196, g: 0.0, b: 0.30196078431372547, a: 1.0 }), iarc_rating_id: None, prefer_related_applications: false, related_applications: [], protocol_handlers: [], shortcuts: [], share_target: None, icons: [IconResource { src: Absolute(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("DOMAINE.NAME")), port: None, path: "/apps/theming/icon/files", query: Some("v=10"), fragment: None }), type: Some("image/png"), sizes: {Fixed(512, 512)}, purpose: {Any}, label: None }, IconResource { src: Absolute(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("DOMAINE.NAME")), port: None, path: "/apps/theming/favicon/files", query: Some("v=10"), fragment: None }), type: Some("image/svg+xml"), sizes: {Fixed(16, 16)}, purpose: {Any}, label: None }], screenshots: [] } }})
08:18:35 [INFO] Sent a response
08:18:35 [INFO] Connection established: ["/nix/store/qdi0ykbv8qbnb9mk5aqjr0218g6d63vw-firefoxpwa-2.11.1/bin/firefoxpwa-connector", "/nix/store/6mi9apwyql6sirwsccgqv23avw5aqpwd-firefox-124.0.2/lib/mozilla/native-messaging-hosts/firefoxpwa.json", "firefoxpwa@filips.si"]
08:18:35 [INFO] Received a request: GetConfig(GetConfig)
08:18:35 [INFO] Processed the request: Config(Config { always_patch: false, runtime_enable_wayland: false, runtime_use_xinput2: false, runtime_use_portals: false })
08:18:35 [INFO] Sent a response
08:18:35 [INFO] Connection established: ["/nix/store/qdi0ykbv8qbnb9mk5aqjr0218g6d63vw-firefoxpwa-2.11.1/bin/firefoxpwa-connector", "/nix/store/6mi9apwyql6sirwsccgqv23avw5aqpwd-firefox-124.0.2/lib/mozilla/native-messaging-hosts/firefoxpwa.json", "firefoxpwa@filips.si"]
08:18:35 [INFO] Received a request: GetProfileList(GetProfileList)
08:18:35 [INFO] Processed the request: ProfileList({Ulid(0): Profile { ulid: Ulid(0), name: Some("Default"), description: Some("Default profile for all web apps"), sites: [] }, Ulid(2070313890124831775813507290021981675): Profile { ulid: Ulid(2070313890124831775813507290021981675), name: Some("Netxcloud"), description: None, sites: [Ulid(2070313890796545773615676478447194990)] }})
08:18:35 [INFO] Sent a response
08:18:40 [INFO] Connection established: ["/nix/store/qdi0ykbv8qbnb9mk5aqjr0218g6d63vw-firefoxpwa-2.11.1/bin/firefoxpwa-connector", "/nix/store/6mi9apwyql6sirwsccgqv23avw5aqpwd-firefox-124.0.2/lib/mozilla/native-messaging-hosts/firefoxpwa.json", "firefoxpwa@filips.si"]
08:18:40 [INFO] Received a request: LaunchSite(LaunchSite { id: Ulid(2070313890796545773615676478447194990), url: [] })
08:18:40 [INFO] Launching the web app
08:18:40 [ERROR] Failed to process request

Caused by:
    No such file or directory (os error 2)
08:18:40 [INFO] Sent a response

firefoxpwa-stderr.log :

08:18:40 [INFO] Launching the web app

firefoxpwa-stdout.log : empty

filips123 commented 4 months ago

I think the error happens when the program tries to launch the runtime, but firefox binary doesn't exist. Please also check if ~/.local/share/firefoxpwa/runtime/ exists and if it contains Firefox installation, and if file permissions are set correctly (at least read and execute).

Thatoo commented 4 months ago

Here are files and permission of this folder :

:~/.local/share/firefoxpwa/runtime$ ls -al
total 197012
drwxr-xr-x 8 thatoo users      4096  5 nov.  16:17 .
drwxr-xr-x 4 thatoo users      4096 12 avril 10:23 ..
-rw-r--r-- 1 thatoo users      1323  5 nov.  16:17 active-update.xml
-rw-r--r-- 1 thatoo users       899  6 juil.  2023 application.ini
-rw-r--r-- 1 thatoo users       649  3 avril 11:41 _autoconfig.cfg
drwxr-xr-x 4 thatoo users      4096  6 juil.  2023 browser
-rwxr-xr-x 1 thatoo users    257744  6 juil.  2023 crashreporter
-rw-r--r-- 1 thatoo users      3902  6 juil.  2023 crashreporter.ini
drwxr-xr-x 3 thatoo users      4096  6 juil.  2023 defaults
-rw-r--r-- 1 thatoo users       174  6 juil.  2023 dependentlibs.list
-rwxr-xr-x 1 thatoo users     14416  6 juil.  2023 firefox
-rwxr-xr-x 1 thatoo users    716216  6 juil.  2023 firefox-bin
-rw-r--r-- 1 thatoo users      1449  6 juil.  2023 firefox-bin.sig
-rw-r--r-- 1 thatoo users      1449  6 juil.  2023 firefox.sig
drwxr-xr-x 2 thatoo users      4096  6 juil.  2023 fonts
drwxr-xr-x 3 thatoo users      4096  6 juil.  2023 gmp-clearkey
drwxr-xr-x 2 thatoo users      4096  6 juil.  2023 icons
-rwxr-xr-x 1 thatoo users    821632  6 juil.  2023 libfreeblpriv3.so
-rwxr-xr-x 1 thatoo users    367872  6 juil.  2023 libipcclientcerts.so
-rwxr-xr-x 1 thatoo users     43200  6 juil.  2023 liblgpllibs.so
-rwxr-xr-x 1 thatoo users   3872568  6 juil.  2023 libmozavcodec.so
-rwxr-xr-x 1 thatoo users    240456  6 juil.  2023 libmozavutil.so
-rwxr-xr-x 1 thatoo users     14136  6 juil.  2023 libmozgtk.so
-rwxr-xr-x 1 thatoo users    117376  6 juil.  2023 libmozsandbox.so
-rwxr-xr-x 1 thatoo users   1220328  6 juil.  2023 libmozsqlite3.so
-rwxr-xr-x 1 thatoo users     18224  6 juil.  2023 libmozwayland.so
-rwxr-xr-x 1 thatoo users    223024  6 juil.  2023 libnspr4.so
-rwxr-xr-x 1 thatoo users    707032  6 juil.  2023 libnss3.so
-rwxr-xr-x 1 thatoo users    535608  6 juil.  2023 libnssckbi.so
-rwxr-xr-x 1 thatoo users    187416  6 juil.  2023 libnssutil3.so
-rwxr-xr-x 1 thatoo users     22656  6 juil.  2023 libplc4.so
-rwxr-xr-x 1 thatoo users     14376  6 juil.  2023 libplds4.so
-rwxr-xr-x 1 thatoo users    163456  6 juil.  2023 libsmime3.so
-rwxr-xr-x 1 thatoo users    321992  6 juil.  2023 libsoftokn3.so
-rwxr-xr-x 1 thatoo users    414344  6 juil.  2023 libssl3.so
-rwxr-xr-x 1 thatoo users 155436824  6 juil.  2023 libxul.so
-rw-r--r-- 1 thatoo users      1449  6 juil.  2023 libxul.so.sig
-rwxr-xr-x 1 thatoo users   1575568  6 juil.  2023 minidump-analyzer
-rw-r--r-- 1 thatoo users  32713148  6 juil.  2023 omni.ja
-rwxr-xr-x 1 thatoo users    773536  6 juil.  2023 pingsender
-rw-r--r-- 1 thatoo users       167  6 juil.  2023 platform.ini
-rwxr-xr-x 1 thatoo users    707936  6 juil.  2023 plugin-container
-rw-r--r-- 1 thatoo users      1449  6 juil.  2023 plugin-container.sig
-rw-r--r-- 1 thatoo users      1960  6 juil.  2023 precomplete
-rw-r--r-- 1 thatoo users         0  6 juil.  2023 removed-files
-rw-r--r-- 1 thatoo users       825  6 juil.  2023 Throbber-small.gif
-rwxr-xr-x 1 thatoo users     97576  6 juil.  2023 updater
-rw-r--r-- 1 thatoo users       638  6 juil.  2023 updater.ini
drwxr-xr-x 4 thatoo users      4096 16 oct.  10:31 updates
-rw-r--r-- 1 thatoo users       132  6 juil.  2023 update-settings.ini
-rw-r--r-- 1 thatoo users      4309 16 oct.  10:31 updates.xml
filips123 commented 4 months ago

Permissions look fine, so I don't know what's the issue. Maybe the package maintainers can take a look at this. I will maybe take a look at this in the future, but I currently don't have time and any NixOS installation, so unfortunately it may take a while.

Also, a bit more details: Considering that "Launching the web app" gets printed, the launching should have been executed at least until here. The site.launch was probably also executed, as it doesn't contain any calls that could fail (except launching the runtime at the end). So, the only place where this error could happen is runtime.run.

(Also, I should probably improve these error messages to tell more precisely where the error happened and which file didn't exist... I will try to improve this in the future.)

pasqui23 commented 4 months ago

Did you try to install the latest firefoxpwa from nixos-unstable and check if a pwa does run?

Thatoo commented 4 months ago

Indeed as there is no firefoxpwa for 23.11 stable.

pasqui23 commented 4 months ago

Have you tried deleting .local/share/firefoxpwa and then adding back manually a pwa?

Thatoo commented 4 months ago

I didn't and when I tried, it solved the issue, thanks!