tauri-apps / tauri

Build smaller, faster, and more secure desktop and mobile applications with a web frontend.
https://tauri.app
Apache License 2.0
84.17k stars 2.53k forks source link

[bug] GLib-Critical: Operation not permitted #5130

Closed Apogeum12 closed 2 years ago

Apogeum12 commented 2 years ago

Describe the bug

The running app print in the console the message: (process:21774): GLib-CRITICAL **: 12:12:24.158: Failed to set scheduler settings: Operation not permitted

Reproduction

In developer mode: npm run tauri dev

Production app version: npm run tauri build

Expected behavior

Clear console output without critical communication.

Platform and versions

Stack trace

No response

Additional context

Log:

$ npm run tauri dev

> guprod@0.15.0 tauri
> tauri

     Running BeforeDevCommand (`npm run dev`)
        Warn Waiting for your frontend dev server to start on http://localhost:3000/...

> guprod@0.15.0 dev
> vite

  vite v2.9.15 dev server running at:

  > Local: http://localhost:3000/
  > Network: use `--host` to expose

  ready in 444ms.

        Info Watching /home/legion/github_project/guprod/src-tauri for changes...
   Compiling app v0.15.0 (/home/legion/github_project/guprod/src-tauri)
    Finished dev [unoptimized + debuginfo] target(s) in 15.95s
System name:             "Ubuntu"
System OS version:       "20.04"
System Host version:       "legion"
System name:             "Ubuntu"
System OS version:       "20.04"
System Host version:       "legion"
System name:             "Ubuntu"
System OS version:       "20.04"
System Host version:       "legion"

(process:35652): GLib-CRITICAL **: 12:24:44.966: Failed to set scheduler settings: Operation not permitted
System name:             "Ubuntu"
System OS version:       "20.04"
System Host version:       "legion"

(process:35657): GLib-CRITICAL **: 12:24:45.411: Failed to set scheduler settings: Operation not permitted
FabianLars commented 2 years ago

1) Is this a new blank tauri project? Or did you change anything? In case you did change anything we'd need a reproduction example. 2) Did you try upgrading your system dependencies? The only somewhat similar issues i found on the internet were all fixed in newer glib versions 3) So far you're the very first one reporting this so if 2. doesn't fix it this probably won't be much fun 😅

Apogeum12 commented 2 years ago

@FabianLars Frontend is Vite React.js

  1. Isn't blank tauri project, I added splashscreen and some changes in tauri.conf :
    {
    "$schema": "../node_modules/@tauri-apps/cli/schema.json",
    "build": {
        "beforeBuildCommand": "npm run build",
        "beforeDevCommand": "npm run dev",
        "devPath": "http://localhost:3000",
        "distDir": "../dist"
    },
    "package": {
        "productName": "guprod",
        "version": "0.15.0"
    },
    "tauri": {
        "allowlist": {
            "all": true
        },
        "bundle": {
            "active": true,
            "category": "DeveloperTool",
            "copyright": "",
            "deb": {
                "depends": []
            },
            "externalBin": [],
            "icon": [
                "icons/32x32.png",
                "icons/128x128.png",
                "icons/128x128@2x.png",
                "icons/icon.icns",
                "icons/icon.ico"
            ],
            "identifier": "pl.guprod.pro",
            "longDescription": "GUI app for working on server",
            "macOS": {
                "entitlements": null,
                "exceptionDomain": "",
                "frameworks": [],
                "providerShortName": null,
                "signingIdentity": null
            },
            "resources": [],
            "shortDescription": "",
            "targets": ["deb", "dmg", "msi"],
            "windows": {
                "certificateThumbprint": null,
                "digestAlgorithm": "sha256",
                "timestampUrl": ""
            }
        },
        "security": {
            "csp": null
        },
        "updater": {
            "active": false
        },
        "windows": [
            {
                "label": "main",
                "center": true,
                "fullscreen": false,
                "minWidth": 380,
                "minHeight": 660,
                "height": 640,
                "resizable": true,
                "title": "guprod",
                "width": 1024,
                "visible": false
            },
            {
                "label": "splashscreen",
                "center": true,
                "width": 256,
                "height": 256,
                "url": "splashscreen.html",
                "decorations": false,
                "resizable": false
            }
        ]
    }
    }

    main.rs :

    
    #![cfg_attr(
    all(not(debug_assertions), target_os = "windows"),
    windows_subsystem = "windows"
    )]

use sysinfo::{System, SystemExt}; use tauri::{Manager}; use std::time::Duration;

[tauri::command]

async fn close_splashscreen(window: tauri::Window){ if let Some(splashscreen) = window.get_window("splashscreen"){ let _two_sec = std::thread::sleep(Duration::new(2, 500_000_000)); splashscreen.close().unwrap(); } window.get_window("main").unwrap().show().unwrap(); }

fn main() {

let context = tauri::generate_context!(); tauri::Builder::default() .invoke_handler(tauri::generate_handler![close_splashscreen, base_information]) // Past here function or Object to send? .run(context) .expect("error while running tauri application"); }

[tauri::command]

fn base_information(){ let mut sys = System::new_all(); sys.refresh_all();

println!("System name: {:?}", sys.name().as_ref().map(String::as_str).unwrap()); println!("System OS version: {:?}", sys.os_version().as_ref().map(String::as_str).unwrap()); println!("System Host version: {:?}", sys.host_name().as_ref().map(String::as_str).unwrap()); }


2. I installed some non-installed (missing*) packages 
- \* - They don't help so I think it isn't required :)
> - libgtk2.0-cil -> focal 2.12.40-3 amd64
> - libc6-amd64-cross -> focal-updates,focal-updates 2.31-0ubuntu9.9cross1 all

## Blank  tauri project ##
I tried install empty vite react ts project to check and confirm if error is still occurs.
```sh
$ npm create tauri-app
$ npm i

debug:

$ npm run tauri dev

And Bug is still occurs. :(

blank_tauri

abukhadra commented 2 years ago

Having the same issue on MacOS when creating blank projects using the vite option.

tauri.conf.json is generated with "devPath" set to port 3000, should be 5173

"build": {  
             .....
     "devPath": "http://localhost:3000",
},
kfiven commented 2 years ago

Getting the same error when I run Cinny.AppImage in Ubuntu 20.04.4 LTS.

ryanrussell commented 2 years ago

Seeing the same error.

To reproduce:

cargo create-tauri-app --template svelte-ts  # Choose pnpm / app name "demo"
  cd demo/
  pnpm i
  pnpm tauri dev

env:

$ rustc --version
rustc 1.64.0 (a55dd71d5 2022-09-19)

$ pnpm -v
7.13.0

$ uname -a
Linux ryan-desktop-gpu 5.15.0-48-generic #54~20.04.1-Ubuntu SMP Thu Sep 1 16:17:26 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
#stdout from `pnpm tauri dev`
...
    Finished dev [unoptimized + debuginfo] target(s) in 1m 45s

(process:734023): GLib-CRITICAL **: 07:02:41.906: Failed to set scheduler settings: Operation not permitted
FabianLars commented 2 years ago

Going to close this because it only concerns Ubuntu 20.04, doesn't seem to actually cause any real issues, and most importantly, afaik is completely outside our control (= upstream issue in the system dependencies).

Thanks for the reports! ❤️

cosoc commented 1 year ago

debian 11 have this tips

LIMPIX31 commented 1 year ago

I encountered the exact same problem on Ubuntu 20.04. How did you solve it?