Jump to content

Cura doesn't launch external links on Ubuntu. API doesn't starts


fjleon
Go to solution Solved by fjleon,

Recommended Posts

Posted · Cura doesn't launch external links on Ubuntu. API doesn't starts

Using Ultimaker Cura and Ubuntu, when I click on some buttons nothing happens. Buttons are:

- Sign in (see attached screenshot on two different Cura versions)

- Show online troubleshooting guide (see attached screenshot)

- Download (see attached screenshot)

 

In the log flle I can read that


2023-09-04 17:54:07,053 - DEBUG - [MainThread] cura.OAuth2.AuthorizationService.startAuthorizationFlow [189]: Starting new OAuth2 flow...
2023-09-04 17:54:07,053 - DEBUG - [MainThread] cura.OAuth2.LocalAuthorizationServer.start [64]: Starting local web server to handle authorization callback on port 32118
2023-09-04 17:54:07,055 - DEBUG - [Thread-8 (_serve_forever)] cura.OAuth2.LocalAuthorizationServer._serve_forever [101]: Local web server for authorization has started
2023-09-04 17:54:08,229 - DEBUG - [MainThread] cura.OAuth2.AuthorizationService.startAuthorizationFlow [189]: Starting new OAuth2 flow...
2023-09-04 17:54:08,230 - DEBUG - [MainThread] cura.OAuth2.LocalAuthorizationServer.start [57]: Auth web server was already running. Updating the verification code
2023-09-04 17:54:09,811 - DEBUG - [MainThread] cura.AutoSave._onTimeout [64]: Autosaving preferences, instances and profiles took 0.051640987396240234 seconds
2023-09-04 17:55:03,236 - DEBUG - [MainThread] cura.OAuth2.AuthorizationService.startAuthorizationFlow [189]: Starting new OAuth2 flow...
2023-09-04 17:55:03,237 - DEBUG - [MainThread] cura.OAuth2.LocalAuthorizationServer.start [57]: Auth web server was already running. Updating the verification code
2023-09-04 17:55:04,261 - DEBUG - [MainThread] cura.OAuth2.AuthorizationService.startAuthorizationFlow [189]: Starting new OAuth2 flow...
2023-09-04 17:55:04,261 - DEBUG - [MainThread] cura.OAuth2.LocalAuthorizationServer.start [57]: Auth web server was already running. Updating the verification code
2023-09-04 17:55:04,581 - DEBUG - [MainThread] cura.OAuth2.AuthorizationService.startAuthorizationFlow [189]: Starting new OAuth2 flow...
2023-09-04 17:55:04,582 - DEBUG - [MainThread] cura.OAuth2.LocalAuthorizationServer.start [57]: Auth web server was already running. Updating the verification code
2023-09-04 17:55:06,197 - DEBUG - [MainThread] cura.OAuth2.AuthorizationService.startAuthorizationFlow [189]: Starting new OAuth2 flow...
2023-09-04 17:55:06,198 - DEBUG - [MainThread] cura.OAuth2.LocalAuthorizationServer.start [57]: Auth web server was already running. Updating the verification code

 

When I launch on the navigator 

http://localhost:32118/ the conection is refused

 

Ubuntu version used 22.04LTS

Cura version used 4.13.0 and 5.4.0

No Proxy and Antivirus and Firewall was disabled for debugging

 

Something is blocking the API access, and I don't know how to solve it.

Any idea?

 

 

Capturadesde2023-08-2911-50-14.thumb.png.9332962754b186dba377f5e9ae1809b3.pngCapturadesde2023-08-2911-45-25.thumb.png.030a47f0b7ae5b50e42e780b2b3d2b84.pngCapturadesde2023-08-2911-47-34.thumb.png.cfd94ec64373c75d7ecbe37ec66d7a29.png

  • Link to post
    Share on other sites

    Posted · Cura doesn't launch external links on Ubuntu. API doesn't starts

    Did you install the Snap package for it or a regular package? Both are in the Ubuntu software program, on an application's page at the top right it should tell you its source.

     

    If you downloaded the Snap, then my guess would be that it's because Snap programs are run in a sandbox with very limited access to the rest of the system - I'd be very surprised if it allowed a web server access to the system (I could be wrong, not hugely experienced with Snaps because *twenty minute rant* and that's why I use openSUSE Tumbleweed).

     

    Both versions of Cura in the Ubuntu software repositories are old, anyway (4.13.2 for the Snap and 4.13.0 for the regular package). The best option is to download an AppImage from the Cura homepage.

    • Like 1
    Link to post
    Share on other sites

    Posted · Cura doesn't launch external links on Ubuntu. API doesn't starts

    Thanks for your answer.

     

    Snap is used for update packages

    Ultimaker-Cura-5-4-0-linux-,modern.AppImage is used and the Ubuntu behaviour is the same.

     

     

  • Link to post
    Share on other sites

    • Solution
    Posted · Cura doesn't launch external links on Ubuntu. API doesn't starts

    SOLVED ! 

    I was trying different ways to solve it, and finally, following your clue about SNAP, I could solve it using  the SNAP console way of installation. https://snapcraft.io/install/cura-slicer/ubuntu

     

    sudo apt update
    sudo apt install snapd
    

    And:

    sudo snap install cura-slicer

    Thanks

    • Like 1
    Link to post
    Share on other sites

    Posted · Cura doesn't launch external links on Ubuntu. API doesn't starts

    To anyone reading this: if you want to see what's actually relevant to the troubleshooting, scroll down to the bit in bold.

     

    3 hours ago, fjleon said:

    Snap is used for update packages

    Snap is a container format designed to contain a program and all of its dependencies (i.e. the libraries it uses) in a single package to be run in a sandboxed environment for security. It exists to avoid the "dependency hell" problem you can have with Linux, where different programs are programmed with the expected behaviour of different versions of common libraries (shared between all the regular executables - not container formats - on the system) which can potentially break older software if a newer version of the library which deprecates or removes older features is installed.

     

    It is proprietary to Canonical (the company that develops Ubuntu) who host the single repository from which Snap files are distributed, and pretty much the rest of the Linux community hates it and uses the completely open alternative, Flatpak. Even most Linux distributions derived from Ubuntu remove Snap support and include Flatpak support by default.

    /\ Rant about Ubuntu and Snaps

    \/ Actual troubleshooting BTW I am including information for people not too familiar with Linux.

    Anyway, back to my investigations (running Ubuntu in a VM). Annoyed the libfuse2 isn't installed by default so I have to go to the terminal to install that before I can even run an AppImage (it mounts itself in a virtual filesystem and runs there; FUSE is the Linux driver for filesystems in userspace, which allows filesystems to be safely be mounted as required with having access to the kernel).

     

    Running the AppImage from a terminal, keeping a look at the terminal output as it's running, whenever I clicked the button to sign in, this popped up:

     

    mkdir: cannot create directory ‘/run/user/0’: Permission denied
    Authorization required, but no authorization protocol specified
    Error: cannot open display: :0

     

    I didn't bother to look at the Cura logs, but it's entirely possible it's the same problem. Could be trying to write the verification code there and couldn't. Closed Cura, then on a hunch, pressed up in the terminal. I'd run the AppImage using sudo (SuperUserDo, lets you do anything as the root account which can mess with almost anything on the system; it's there to avoid people having to login as root because in case something bad happens, you want it to happen to just your account, not the whole system).

     

    I actually thought the problem might have been that I ran it as a regular user, and it might need root permission to access those directories - it turns out that because of the way the root account works in an AppImage container, it can't create its own directory there (the 0 is because the root account has the user ID 0).

     

    So I ran Cura as my regular user (no sudo) and the sign in process worked flawlessly. So make sure you're running Cura from an account without superuser privileges. The verification code it's generated is probably trying to be stored in your user folder, which won't work as root.

    /\ TL;DR: What worked for me

    \/ A couple of minor technical niggles because I like poking technical niggles

    1) Trying to access that web server process directly from basically any software you'd run (as opposed to software that contains an API that uses it, as Cura - or a browser which supports OAuth which is what it loads - does) is pretty pointless. A web browser will generally only try to connect on port 443 (HTTPS) then fall back to 80 (HTTP). FTP servers use 20 (data transfer) and 21 (commands) or just 22 (if using Secure FTP). About the only thing that would find it is a port scanner looking for open ports.

    2) Trying to access something on your computer using localhost should work in almost any situation, but it's not an iron-clad guarantee - it's just an alias defined in /etc/hosts and redirects to 127.0.0.1 (the IPv4 loopback address). You should probably use 127.0.0.1 (IPv4) or ::1 (loopback address for IPv6) to access your own system.

    3) Even with any user facing antivirus or firewalls turned off, there's still lots of services running in the background which could interfere with network traffic. In my fresh install of 22.04 there's netns, inet_frag_ml, watchdogd, ipv6_addrconf, systemd-timesyncd, avahi-daemon, NetworkManager, networkd-dispatcher, wpa-supplicant, ModemManager, systemd-hostnamed and probably some others I don't recognise by name.

  • Link to post
    Share on other sites

    Posted · Cura doesn't launch external links on Ubuntu. API doesn't starts
    1 minute ago, fjleon said:

    SOLVED ! 

    I was trying different ways to solve it, and finally, following your clue about SNAP, I could solve it using  the SNAP console way of installation. https://snapcraft.io/install/cura-slicer/ubuntu

     

    sudo apt update
    sudo apt install snapd
    

    And:

    sudo snap install cura-slicer

    Thanks

    Well, if that's what works for you, I'm happy to take the credit 🙂

    • Like 1
    Link to post
    Share on other sites

    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now
    • Our picks

      • Introducing the UltiMaker Factor 4
        We are happy to announce the next evolution in the UltiMaker 3D printer lineup: the UltiMaker Factor 4 industrial-grade 3D printer, designed to take manufacturing to new levels of efficiency and reliability. Factor 4 is an end-to-end 3D printing solution for light industrial applications
          • Thanks
          • Like
        • 3 replies
      • UltiMaker Cura 5.7 stable released
        Cura 5.7 is here and it brings a handy new workflow improvement when using Thingiverse and Cura together, as well as additional capabilities for Method series printers, and a powerful way of sharing print settings using new printer-agnostic project files! Read on to find out about all of these improvements and more. 
         
          • Like
        • 26 replies
    ×
    ×
    • Create New...