NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.69k stars 13.14k forks source link

Appimage-run: Browser redirect for login not working #256864

Open wueestry opened 10 months ago

wueestry commented 10 months ago

Describe the bug

In order to login to nvidias' omniverse appimage, it requires a login via browser redirection. After entering your email you should be redirected to the browser to authenticate yourself. The login page is opened on localhost:33480/ but the redirection back to the appimage does not work (after confirmation to let app access browser redirection).

Steps To Reproduce

Steps to reproduce the behavior:

  1. Install appimage-run
  2. Download Omniverse appimage
  3. Run appimage-run omniverse-launcher-linux
  4. Enter email address in login
  5. Enter password in browser to complete authentication

Expected behavior

After entering password in browser should result appimage to complete authentication and allow access to app, but app stuck in login screen

Screenshots

11:36:53.859 › (node:2) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, access '~/.nvidia-omniverse/config/auth.toml'
11:36:53.859 › (node:2) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 33)

Getting these messages when running the appimage. Not sure if they affect the result of the login process. But the message keeps spawning every 5 seconds.

Notify maintainers

@symphorien

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.46, NixOS, 23.05 (Stoat), 23.05.20230823.fc94491`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.5`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
symphorien commented 10 months ago

I'm unsure, but I think the browser relies on desktop files to "open the link in app X", so can you check that the appimage created such a desktop file (presumably in ~/.local/share/applications), and that it is correct? Most probably it tries to execute the appimage without appimage-run. In this case you can edit it to fix it.

wueestry commented 10 months ago

Great idea, but sadly it didn't work Just to be sure that I understood you correctly I modified the automatically created .desktop file Screenshot from 2023-09-25 11-41-38 by changing the exec path Screenshot from 2023-09-25 11-40-51

I think the app somehow gets a response from the browser, as the following message appeared in the terminal: WEB /login-result?ui_locales=en&code=a65RF6cUCG_07NWzssM6NNz6ZkcEkRoeB7yVTjs57t0fQ1gm19CNkm2J2w8mTXZ94Agusbbfj29mR5JIjWVj1Q but the login still didn't progress correctly

symphorien commented 10 months ago

Then I'm out of ideas, sorry.

zaesur commented 3 months ago

@wueestry Have you been able to install Omniverse on NixOS meanwhile? Currently facing the same issue!

wueestry commented 3 months ago

No I haven't been able to fix it. Had to use another distro in the end

TheDelus commented 3 months ago

@zaesur @wueestry This is working for me:

{ appimageTools }:
appimageTools.wrapType2 {
  name = "omniverse-launcher";
  src = ./omniverse-launcher-linux.AppImage;
  extraInstallCommands = ''
      mkdir -p $out/share/applications
      echo "[Desktop Entry]
Exec=omniverse-launcher  %u
Terminal=false
Type=Application
Name=omniverse-launcher
MimeType=x-scheme-handler/omniverse-launcher" > $out/share/applications/omniverse-launcher.desktop
  '';
}
HanClinto commented 3 months ago

Getting a very similar issue when running on remote Ubuntu 20.04 machine with xfce4 as the window manager.

Login completes in the web browser, but nothing ever continues from the installer -- continues to just hang.

breakds commented 2 months ago

@zaesur @wueestry This is working for me:

{ appimageTools }:
appimageTools.wrapType2 {
  name = "omniverse-launcher";
  src = ./omniverse-launcher-linux.AppImage;
  extraInstallCommands = ''
      mkdir -p $out/share/applications
      echo "[Desktop Entry]
Exec=omniverse-launcher  %u
Terminal=false
Type=Application
Name=omniverse-launcher
MimeType=x-scheme-handler/omniverse-launcher" > $out/share/applications/omniverse-launcher.desktop
  '';
}

Thanks a lot for the recipe. It works perfectly for me. A slightly modified version:

{ lib
, fetchurl
, writeText
, appimageTools
}:

  let omniverse-launcher-desktop = writeText "omniverse-launcher.desktop" ''
        [Desktop Entry]
        Exec=omniverse-launcher %u
        Terminal=false
        Type=Application
        Name=omniverse-launcher
        MimeType=x-scheme-handler/omniverse-launcher
      '';

  in appimageTools.wrapType2 {
    name = "omniverse-launcher";

    src = fetchurl {
      url = "<in case you put the image file somewhere accessible>";
      sha256 = "...";
    };

    extraInstallCommands = ''
      mkdir -p $out/share/applications
      ln -s ${omniverse-launcher-desktop} $out/share/applications/omniverse-launcher.desktop
    '';
  }
breakds commented 2 months ago

There is one more issue though. When try to install isaac-sim from the launcher, I got the following error in the log:

11:36:14.634 › [01a53fb4-2c0f-466f-976a-1b8f5c62af49] Extracting isaac_sim@2023.1.1 to /home/breakds/.local/share/ov/pkg/isaac_sim-2023.1.1...
11:36:14.640 › (node:24675) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `omniverse-launcher --trace-deprecation ...` to show where the warning was created)
11:38:38.655 › [01a53fb4-2c0f-466f-976a-1b8f5c62af49] Load installation scripts from /home/breakds/.local/share/ov/pkg/isaac_sim-2023.1.1
11:38:38.896 › [01a53fb4-2c0f-466f-976a-1b8f5c62af49] Post-install /home/breakds/.local/share/ov/pkg/isaac_sim-2023.1.1/omni.isaac.sim.post.install.sh
11:38:38.896 › Running "/home/breakds/.local/share/ov/pkg/isaac_sim-2023.1.1/omni.isaac.sim.post.install.sh"
11:38:38.923 › Dequeue [01a53fb4-2c0f-466f-976a-1b8f5c62af49] isaac_sim.
11:38:38.924 › Reset current installer.
11:38:38.924 › [01a53fb4-2c0f-466f-976a-1b8f5c62af49] Removing the artifact path /home/breakds/.local/share/ov/pkg/isaac_sim-2023.1.1/Isaac Sim.zip due to an error.
11:38:40.050 › [01a53fb4-2c0f-466f-976a-1b8f5c62af49] Removing the installation path /home/breakds/.local/share/ov/pkg/isaac_sim-2023.1.1 due to an error.
11:38:41.853 › Error: Isaac Sim Post-Installation Script
Creating extension_examples symlink...
~/.local/share/ov/pkg/isaac_sim-2023.1.1 ~
~

And the installation is going to fail. I suspect we will need to patch isaac sim's installation script, but it gets deleted after the failure of installation.

TheDelus commented 2 months ago

Yes I encountered the same issue. I opted for the streaming client and let isaac run in the cloud. Haven't really tried to fix the install error though.

breakds commented 2 months ago

I see. Good to know that there is streaming client and it can work. Thanks!

breakds commented 2 months ago

Apparently their "installation" is just "unzipping", and their "post-installation" is just about running a bash script. I suspect the failure is caused by #!/bin/bash (which could be modified as #!/usr/bin/env bash). I tried to quickly update the script with that, but it didn't work and the same error persists.

dagelf commented 3 days ago

Nvidia Omniverse wants to be able to launch itself from your browser (and startup) - but it doesn't register the url handler properly if running the Appimage, because it can't.

To log in, it takes you to a browser, and then just never logs in. Solution is to copy the url from your browser and run the AppImage with that url as a paramater. (While keeping the original instance you launched, open)

$ ./omniverse-launcher-linux.AppImage 'omniverse-launcher://login?state=...

(https://forums.developer.nvidia.com/t/omniverse-launcher-appimage-login-not-working-solution/300098)