filips123 / PWAsForFirefox

A tool to install, manage and use Progressive Web Apps (PWAs) in Mozilla Firefox
https://pwasforfirefox.filips.si
Mozilla Public License 2.0
2.19k stars 52 forks source link

[ERROR] No such file or directory (os error 2) #91

Closed Kreyren closed 2 years ago

Kreyren commented 2 years ago

Description

Refuses to open the website with No such file or directory (os error 2) in both icecat and CLI

kreyren@leonid ~$ /usr/bin/firefoxpwa profile list
========================= Default ==========================
Description: Default profile for all sites
ID: 00000000000000000000000000

========================= Element ==========================
Description: Profile for element
ID: REDACTED

Sites:
- Element: https://chat.tchncs.de/manifest.json (REDACTED)

kreyren@leonid ~$ /usr/bin/firefoxpwa site launch REDACTED
10:29:35 [INFO] Patching the runtime
10:29:35 [INFO] Runtime patched!
10:29:35 [INFO] Patching the profile
10:29:35 [INFO] Profile patched!
10:29:35 [INFO] Launching the site
10:29:35 [ERROR] No such file or directory (os error 2)

Following https://github.com/filips123/FirefoxPWA/wiki/Troubleshooting:

  1. Console doesn't print anything useful
  2. Installed glibc-2.31 -> Same issue

firefoxpwa-stderr.log

10:42:38 [INFO] Connection established: ["/usr/libexec/firefoxpwa-connector", "/usr/lib/mozilla/native-messaging-hosts/firefoxpwa.json", "firefoxpwa@filips.si"]
10:42:38 [INFO] Received a request: GetSiteList
10:42:38 [INFO] Processed the request: SiteList({Ulid(1980649456936945002128192225490627497): Site { ulid: Ulid(1980649456936945002128192225490627497), profile: Ulid(1980647903147576346208093903090403324), config: SiteConfig { name: None, description: None, start_url: None, document_url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("chat.tchncs.de")), port: None, path: "/", query: None, fragment: Some("/welcome") }, manifest_url: Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("chat.tchncs.de")), port: None, path: "/manifest.json", query: None, fragment: None }, categories: [], keywords: [] }, manifest: WebAppManifest { start_url: Absolute(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("chat.tchncs.de")), port: None, path: "/index.html", query: None, fragment: None }), scope: Absolute(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("chat.tchncs.de")), port: None, path: "/", query: None, fragment: None }), name: Some("Element"), short_name: Some("Element"), description: None, categories: [], keywords: [], dir: Auto, lang: None, display: Standalone, orientation: Any, background_color: None, theme_color: Some(Color { r: 0.4627450980392157, g: 0.8117647058823529, b: 0.6509803921568628, a: 1.0 }), iarc_rating_id: None, prefer_related_applications: false, related_applications: [ExternalApplicationResource { platform: "play", min_version: None, url: Some(Absolute(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("play.google.com")), port: None, path: "/store/apps/details", query: Some("id=im.vector.app"), fragment: None })), id: Some("im.vector.app"), fingerprints: [] }, ExternalApplicationResource { platform: "itunes", min_version: None, url: Some(Absolute(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("apps.apple.com")), port: None, path: "/app/vector/id1083446067", query: None, fragment: None })), id: None, fingerprints: [] }], protocol_handlers: [], shortcuts: [], share_target: None, icons: [IconResource { src: Absolute(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("chat.tchncs.de")), port: None, path: "/vector-icons/44.png", query: None, fragment: None }), type: Some("image/png"), sizes: {Fixed(44, 44)}, purpose: {Any}, label: None }, IconResource { src: Absolute(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("chat.tchncs.de")), port: None, path: "/vector-icons/1240x600.png", query: None, fragment: None }), type: Some("image/png"), sizes: {Fixed(1240, 600)}, purpose: {Any}, label: None }, IconResource { src: Absolute(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("chat.tchncs.de")), port: None, path: "/vector-icons/300.png", query: None, fragment: None }), type: Some("image/png"), sizes: {Fixed(300, 300)}, purpose: {Any}, label: None }, IconResource { src: Absolute(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("chat.tchncs.de")), port: None, path: "/vector-icons/150.png", query: None, fragment: None }), type: Some("image/png"), sizes: {Fixed(150, 150)}, purpose: {Any}, label: None }, IconResource { src: Absolute(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("chat.tchncs.de")), port: None, path: "/vector-icons/88.png", query: None, fragment: None }), type: Some("image/png"), sizes: {Fixed(88, 88)}, purpose: {Any}, label: None }, IconResource { src: Absolute(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("chat.tchncs.de")), port: None, path: "/vector-icons/24.png", query: None, fragment: None }), type: Some("image/png"), sizes: {Fixed(24, 24)}, purpose: {Any}, label: None }, IconResource { src: Absolute(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("chat.tchncs.de")), port: None, path: "/vector-icons/50.png", query: None, fragment: None }), type: Some("image/png"), sizes: {Fixed(50, 50)}, purpose: {Any}, label: None }, IconResource { src: Absolute(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("chat.tchncs.de")), port: None, path: "/vector-icons/620x300.png", query: None, fragment: None }), type: Some("image/png"), sizes: {Fixed(620, 300)}, purpose: {Any}, label: None }, IconResource { src: Absolute(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("chat.tchncs.de")), port: None, path: "/vector-icons/1024.png", query: None, fragment: None }), type: Some("image/png"), sizes: {Fixed(1024, 1024)}, purpose: {Any}, label: None }, IconResource { src: Absolute(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("chat.tchncs.de")), port: None, path: "/vector-icons/180.png", query: None, fragment: None }), type: Some("image/png"), sizes: {Fixed(180, 180)}, purpose: {Any}, label: None }, IconResource { src: Absolute(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("chat.tchncs.de")), port: None, path: "/vector-icons/152.png", query: None, fragment: None }), type: Some("image/png"), sizes: {Fixed(152, 152)}, purpose: {Any}, label: None }, IconResource { src: Absolute(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("chat.tchncs.de")), port: None, path: "/vector-icons/120.png", query: None, fragment: None }), type: Some("image/png"), sizes: {Fixed(120, 120)}, purpose: {Any}, label: None }, IconResource { src: Absolute(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("chat.tchncs.de")), port: None, path: "/vector-icons/76.png", query: None, fragment: None }), type: Some("image/png"), sizes: {Fixed(76, 76)}, purpose: {Any}, label: None }], screenshots: [] } }})
10:42:38 [INFO] Sent a response
10:42:39 [INFO] Connection established: ["/usr/libexec/firefoxpwa-connector", "/usr/lib/mozilla/native-messaging-hosts/firefoxpwa.json", "firefoxpwa@filips.si"]
10:42:39 [INFO] Received a request: LaunchSite { id: Ulid(1980649456936945002128192225490627497), url: Some(Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("chat.tchncs.de")), port: None, path: "/", query: None, fragment: Some("/welcome") }) }
10:42:39 [INFO] Patching the runtime
10:42:39 [INFO] Runtime patched!
10:42:39 [INFO] Patching the profile
10:42:39 [INFO] Profile patched!
10:42:39 [INFO] Launching the site
10:42:39 [ERROR] Failed to process request

Caused by:
    No such file or directory (os error 2)

Steps to Reproduce

  1. Install the extension
  2. Follow instructions (installed from source)
  3. Try to add any element.io instance as webapp and expect failure

Additional Information

OS: GNU Guix Nix/Linux

kreyren@leonid ~$ guix describe 
Generation 5    Nov 21 2021 16:00:22    (current)
  guix f0a30bf
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: f0a30bf8aac0f2178543f9cd629011eb85f6df48
  nonguix 42346a1
    repository URL: https://gitlab.com/nonguix/nonguix
    branch: master
    commit: 42346a10332e89f3499ec66b3a2b6b1143b61d68

with GNU IceCat

kreyren@leonid ~$ icecat --version
GNU IceCat 91.3.0esr

Affected Websites

Environment

config.scm used to build the system using guix system reconfigure config.scm from guix installer:

;;; Fallback system build
;;; used to fallback to a working system until the presented configuration is finished

;; SECURITY(Krey): Use `linux-libre-lts` kernel instead of the master which is insane

(use-modules (gnu))
(use-modules (gnu packages certs))
(use-modules (gnu packages docker))
(use-modules (gnu services docker))
(use-service-modules
  cups
  desktop
  networking
  ssh
  xorg)

(operating-system
  (locale "en_US.utf8")
  (timezone "Europe/Prague")
  (keyboard-layout (keyboard-layout "us"))
  (host-name "leonid")
  (users (cons* (user-account
                  (name "kreyren")
                  (comment "Jacob Hrbek")
                  (group "users")
                  (home-directory "/home/kreyren")
                  (supplementary-groups
                    '("wheel" "netdev" "audio" "video" "docker")))
     %base-user-accounts))

  (packages (append (list nss-certs docker) %base-packages))
 ;(packages (append (map "nss-certs" "docker") %base-packages))
 ;(packages
    ;(append
     ;(list (specification->package "nss-certs"))
      ;%base-packages))
  (services
    (append
      (list (service xfce-desktop-service-type)
            (service openssh-service-type)
            (service tor-service-type)
        (service docker-service-type)
            (set-xorg-configuration
              (xorg-configuration
                (keyboard-layout keyboard-layout))))
      %desktop-services))
  (bootloader
    (bootloader-configuration
      (bootloader grub-bootloader)
      (targets (list "/dev/sda"))
      (keyboard-layout keyboard-layout)))
  (mapped-devices
    (list (mapped-device
            (source
              (uuid "1fe117ac-fe47-4eb3-a63b-b8a34dee4ea8"))
            (target "cryptroot")
            (type luks-device-mapping))))
  (file-systems
    (cons* (file-system
             (mount-point "/")
             (device "/dev/mapper/cryptroot")
             (type "btrfs")
             (dependencies mapped-devices))
           %base-file-systems)))

Hypothesis

I assume that this is an issue caused by either icecat of Nix's file hierarchy.

You should be able to install guix package on majority of linux/hurd distributions and then just guix pull && guix install icecat should provide the environment, note https://github.com/filips123/FirefoxPWA/pull/88 used to provide the dependencies to build the project.


CC @filips123

filips123 commented 2 years ago

The error probably happend when FirefoxPWA tried to launch your IceCat runtime, but for some reason the binary didn't exist. Can you check if all required runtime files (firefox and application.ini) are in the correct directory? Or maybe this is caused by symlinks you did to link your IceCat installation to FiefoxPWA.

Kreyren commented 2 years ago

Can you check if all required runtime files (firefox and application.ini) are in the correct directory? Or maybe this is caused by symlinks you did to link your IceCat installation to FiefoxPWA. -- @filips123 (https://github.com/filips123/FirefoxPWA/issues/91#issuecomment-986016633)

Can you elaborate? I've symlinked only firefox and firefox-bin to the output of command -v icecat and executing the symlinks opens icecat.

FWIW Guix should already handle the required dependencies for the executables.

filips123 commented 2 years ago

Unfortunately, I don't have much experience with Guix. I thought it may be a problem with symlinks, but if you can execute them directly, it's probably not.

Normally, FirefoxPWA expects that ~/.local/share/firefoxpwa/runtime/ contains completely standalone Firefox installation. It uses application.ini to determine its version and firefox binary to launch it. Before launching, it also copies some files to the runtime directory so Firefox can load the required UI modifications.

On Ubuntu, for example, symlinking only application.ini and firefox binary to globally-installed Firefox won't work, because launching the binary would fail with "Couldn't load XPCOM". Even though Guix seems to be able to correctly handle launching from symlinks, something still causes FirefoxPWA to fail.

I'm not sure how to debug this. Maybe you could try to use strace -f firefoxpwa site launch ... to check if there are any interesting system calls, or modify this code which is used for launching runtime binary and try to debug it somehow. Unfortunately, I won't have much time to debug this until around December 15th, but if you won't be able to solve this yourself until then, I will try to install Guix myself and debug it.

Kreyren commented 2 years ago

Closing in favor of https://github.com/filips123/FirefoxPWA/issues/90 as solution to use native icecat to avoid this issue