Page 1 of 1

MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 8:02 am
by abhidesh128
When MX Package Installer is launched, and clicked on MX Test Repo tab, the following error is shown:

Image

This is a fresh install of MX 23. System info:

Code: Select all

System:
  Kernel: 6.1.0-26-amd64 [6.1.112-1] arch: x86_64 bits: 64 compiler: gcc v: 12.2.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.1.0-26-amd64 root=UUID=<filter> ro quiet splash
    resume=UUID=<filter> resume_offset=12154880 init=/lib/systemd/systemd
  Desktop: KDE Plasma v: 5.27.5 wm: kwin_x11 vt: 7 dm: SDDM Distro: MX-23.4_KDE_x64 Libretto
    September 15 2024 base: Debian GNU/Linux 12 (bookworm)
Machine:
  Type: Desktop System: Dell product: OptiPlex 7060 v: N/A serial: <superuser required> Chassis:
    type: 3 serial: <superuser required>
  Mobo: Dell model: 0DWPVW v: A00 serial: <superuser required> UEFI: Dell v: 1.31.0
    date: 08/01/2024
CPU:
  Info: model: Intel Core i3-8100T bits: 64 type: MCP arch: Coffee Lake gen: core 8 level: v3
    note: check built: 2018 process: Intel 14nm family: 6 model-id: 0x9E (158) stepping: 0xB (11)
    microcode: 0xF6
  Topology: cpus: 1x cores: 4 smt: <unsupported> cache: L1: 256 KiB desc: d-4x32 KiB; i-4x32 KiB
    L2: 1024 KiB desc: 4x256 KiB L3: 6 MiB desc: 1x6 MiB
  Speed (MHz): avg: 900 min/max: 800/3100 scaling: driver: intel_pstate governor: powersave
    cores: 1: 900 2: 900 3: 900 4: 900 bogomips: 24799
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
  Vulnerabilities:
  Type: gather_data_sampling mitigation: Microcode (locked)
  Type: itlb_multihit status: KVM: VMX disabled
  Type: l1tf mitigation: PTE Inversion; VMX: conditional cache flushes, SMT disabled
  Type: mds mitigation: Clear CPU buffers; SMT disabled
  Type: meltdown mitigation: PTI
  Type: mmio_stale_data mitigation: Clear CPU buffers; SMT disabled
  Type: reg_file_data_sampling status: Not affected
  Type: retbleed mitigation: IBRS
  Type: spec_rstack_overflow status: Not affected
  Type: spec_store_bypass mitigation: Speculative Store Bypass disabled via prctl
  Type: spectre_v1 mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2 mitigation: IBRS; IBPB: conditional; STIBP: disabled; RSB filling;
    PBRSB-eIBRS: Not affected; BHI: Not affected
  Type: srbds mitigation: Microcode
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: Intel CoffeeLake-S GT2 [UHD Graphics 630] vendor: Dell driver: i915 v: kernel
    arch: Gen-9.5 process: Intel 14nm built: 2016-20 ports: active: HDMI-A-2 empty: DP-1, DP-2,
    DP-3, HDMI-A-1, HDMI-A-3 bus-ID: 00:02.0 chip-ID: 8086:3e91 class-ID: 0300
  Display: x11 server: X.Org v: 1.21.1.7 with: Xwayland v: 22.1.9 compositor: kwin_x11 driver: X:
    loaded: modesetting unloaded: fbdev,vesa dri: iris gpu: i915 display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1280x800 s-dpi: 96 s-size: 338x211mm (13.31x8.31") s-diag: 398mm (15.69")
  Monitor-1: HDMI-A-2 mapped: HDMI-2 model: HDMI serial: <filter> built: 2048 res: 1280x800
    hz: 60 dpi: 90 gamma: 2.54 size: 360x290mm (14.17x11.42") modes: max: 1280x800 min: 720x400
  API: OpenGL v: 4.6 Mesa 24.2.2-1~mx23ahs renderer: Mesa Intel UHD Graphics 630 (CFL GT2)
    direct-render: Yes
Audio:
  Device-1: Intel Cannon Lake PCH cAVS vendor: Dell driver: snd_hda_intel v: kernel
    alternate: snd_soc_skl,snd_sof_pci_intel_cnl bus-ID: 00:1f.3 chip-ID: 8086:a348 class-ID: 0403
  API: ALSA v: k6.1.0-26-amd64 status: kernel-api tools: alsamixer,amixer
  Server-1: PipeWire v: 1.0.0 status: active with: 1: pipewire-pulse status: active
    2: wireplumber status: active 3: pipewire-alsa type: plugin 4: pw-jack type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Intel Ethernet I219-LM vendor: Dell driver: e1000e v: kernel port: N/A bus-ID: 00:1f.6
    chip-ID: 8086:15bb class-ID: 0200
  IF: eth0 state: down mac: <filter>
  IF-ID-1: wlan0 state: up mac: <filter>
Bluetooth:
  Device-1: Realtek 802.11ac NIC type: USB driver: btusb,rtl8821cu bus-ID: 1-5:2 chip-ID: 0bda:c820
    class-ID: e001 serial: <filter>
  Report: hciconfig ID: hci0 rfk-id: 0 state: down bt-service: enabled,running rfk-block:
    hardware: no software: yes address: <filter>
  Info: acl-mtu: 1021:8 sco-mtu: 255:12 link-policy: rswitch hold sniff park
    link-mode: peripheral accept
Drives:
  Local Storage: total: 350.27 GiB used: 72.39 GiB (20.7%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Lenovo model: LENSE30256GMSP34MEAT3TA
    size: 238.47 GiB block-size: physical: 512 B logical: 512 B speed: 31.6 Gb/s lanes: 4 type: SSD
    serial: <filter> rev: 2.5.0412 temp: 39.9 C scheme: GPT
  ID-2: /dev/sda maj-min: 8:0 vendor: Crucial model: CT120BX500SSD1 size: 111.79 GiB block-size:
    physical: 512 B logical: 512 B speed: 6.0 Gb/s type: SSD serial: <filter> rev: R013 scheme: GPT
Partition:
  ID-1: / raw-size: 60 GiB size: 58.76 GiB (97.93%) used: 30.05 GiB (51.1%) fs: ext4
    dev: /dev/nvme0n1p2 maj-min: 259:2
  ID-2: /boot/efi raw-size: 100 MiB size: 98.4 MiB (98.45%) used: 28 MiB (28.5%) fs: vfat
    dev: /dev/nvme0n1p1 maj-min: 259:1
  ID-3: /home raw-size: 178.38 GiB size: 174.51 GiB (97.83%) used: 42.24 GiB (24.2%) fs: ext4
    dev: /dev/nvme0n1p3 maj-min: 259:3
Swap:
  Kernel: swappiness: 15 (default 60) cache-pressure: 100 (default)
  ID-1: swap-1 type: file size: 19.42 GiB used: 0 KiB (0.0%) priority: -2 file: /swap/swap
Sensors:
  System Temperatures: cpu: 41.0 C pch: 44.0 C mobo: N/A
  Fan Speeds (RPM): N/A
Repos:
  Packages: pm: dpkg pkgs: 2537 libs: 1345 tools: apt,apt-get,aptitude,nala,synaptic pm: rpm
    pkgs: 0 pm: flatpak pkgs: 0
  No active apt repos in: /etc/apt/sources.list
  Active apt repos in: /etc/apt/sources.list.d/debian-stable-updates.list
    1: deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/debian.list
    1: deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
    2: deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
  Active apt repos in: /etc/apt/sources.list.d/mx.list
    1: deb https://mirror.kku.ac.th/mx-packages/mx//repo/ bookworm main non-free
    2: deb https://mirror.kku.ac.th/mx-packages/mx//repo/ bookworm ahs
Info:
  Processes: 213 Uptime: 21m wakeups: 0 Memory: 15.3 GiB used: 2.6 GiB (17.0%) Init: systemd v: 252
  target: graphical (5) default: graphical tool: systemctl Compilers: gcc: 12.2.0 alt: 12
  Client: shell wrapper v: 5.2.15-release inxi: 3.3.26
Boot Mode: UEFI
SecureBoot enabled

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 8:07 am
by Adrian
Can you write with regular user to /tmp? Can you do something like "touch /tmp/testfile"?

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 8:12 am
by abhidesh128
Yes. I was able to touch a testfile in /tmp without sudo.

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 8:15 am
by Adrian
OK... hmm... how do you start the mx-packageinstaller from KDE menu?

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 8:16 am
by abhidesh128
Yes. From the menu.

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 8:23 am
by Adrian
Nevermind, it's my boneheaded way to handle errors, see this:

Code: Select all

    if (reply->error() != QNetworkReply::NoError) {
        QMessageBox::warning(
            this, tr("Error"),
            tr("There was an error writing file: %1. Please check if you have enough free space on your drive")
...
The issue is a network error, not a write error. So for some reason the app cannot download the file. Do you use a proxy? Do you do anything fancy with your networking? Can you access http://mxrepo.com/mx/ ?

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 8:28 am
by j2mcgreg

Code: Select all

SecureBoot enabled
This needs to be disabled and it's the reason that your write to /tmp failed. Te package that you are downloading / installing lacks the signature required by Secure Boot.

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 8:33 am
by Adrian
Are you sure about that? How is SecureBoot changing /tmp write access?

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 8:36 am
by abhidesh128
j2mcgreg wrote: Fri Oct 18, 2024 8:28 am

Code: Select all

SecureBoot enabled
This needs to be disabled and it's the reason that your write to /tmp failed. Te package that you are downloading / installing lacks the signature required by Secure Boot.
Ohh. Can secure boot affect access to /tmp ? BTW, I am not installing anything that needs any signature stuff. MXPI is not able to write package cache.

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 8:39 am
by j2mcgreg
abhidesh128 wrote: Fri Oct 18, 2024 8:36 am
j2mcgreg wrote: Fri Oct 18, 2024 8:28 am

Code: Select all

SecureBoot enabled
This needs to be disabled and it's the reason that your write to /tmp failed. Te package that you are downloading / installing lacks the signature required by Secure Boot.
Ohh. Can secure boot affect access to /tmp ? BTW, I am not installing anything that needs any signature stuff. MXPI is not able to write package cache.
MX is Secure Boot adverse and it needs Secure Boot disabled.

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 8:40 am
by abhidesh128
Adrian wrote: Fri Oct 18, 2024 8:23 am The issue is a network error, not a write error. So for some reason the app cannot download the file. Do you use a proxy? Do you do anything fancy with your networking? Can you access http://mxrepo.com/mx/ ?
I do not use any proxy, but I share network to my computer via mobile hotspot. I'll test my carrier settings and reply back.

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 8:42 am
by Adrian
I doubt it's that, it's a download issue, the error message is wrong, I will fix that.

The question is why can't you download?

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 9:50 am
by abhidesh128
Okay. I can confirm that I can access http://mxrepo.com/mx/ from my computer. When I curl this URL, I get a 301. When I explicitly type https, it does access the root directory of repo. I am not sure of my conclusion, but could the difference be the culprit ?

In the source code -

Code: Select all

 QFile file(tmp_dir.path() + "/mxPackages.gz");
            QString url {"http://mxrepo.com/mx/testrepo/dists/"};
            if (!cmd.run("apt-get update --print-uris | tac | grep -m1 -oP 'https?://.*/mx/testrepo/dists/(?="
                         + ver_name + "/test/)'")) {
                cmd.run("apt-get update --print-uris | tac | grep -m1 -oE 'https?://.*/mx/repo/dists/" + ver_name
                        + "/main/' | sed -e 's:/mx/repo/dists/" + ver_name
                        + "/main/:/mx/testrepo/dists/:' | grep -oE 'https?://.*/mx/testrepo/dists/'");
            }
The URL string is http

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 10:02 am
by Adrian
301 is a permanent redirection, I wonder if it was just forwarded to https. For me that works but I will change the code to use https and also change the error message to add that it could be a download issue.

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 10:39 am
by fehlix
Adrian wrote: Fri Oct 18, 2024 10:02 am 301 is a permanent redirection, I wonder if it was just forwarded to https. For me that works but I will change the code to use https and also change the error message to add that it could be a download issue.
Actualy the reason that it uses the fallback "http://mxrepo.com/mx/testrepo/dists/"
is b/c of this MX repo line within /etc/apt/sources.list.d/mx.list:

Code: Select all

deb https://mirror.kku.ac.th/mx-packages/mx//repo/ bookworm main non-free
The doubled slash "//" bewteen in "mx//repo", prevents the detection of the current used MX-repos.
If the mx-repos list within /etc/apt/sources.list.d/mx.list
would be fixed by replacing the double-slash "//" by one slash "/"

Code: Select all

deb https://mirror.kku.ac.th/mx-packages/mx/repo/ bookworm main non-free
deb https://mirror.kku.ac.th/mx-packages/mx/repo/ bookworm ahs
The MX Package installer would not use the fallback but the testrepo of the current mx-repo.
But anyway, it's good the remove the unneeded redirection and use https://mxrepo.com/
within the fallback.

Re: MX Package Installer has a difficulty writing file in /tmp  [Solved]

Posted: Fri Oct 18, 2024 11:30 am
by abhidesh128
I edited mx.list to remove the extra forward slash and it solved my 2 issues:
  • It solved the download error with MXPI.
  • It solved issue with MX Repo Manager where it was unable to set another mirror.
Although, I am not sure how that extra / appeared in mx.list. This is a fresh install an I did not modify any apt settings. I was unable to do so because repo manager was not having any effect on mx.list. But, both of these issues have been solved now.

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 11:42 am
by Adrian
A new MXPI package upcoming that is using https for mxrepo.com link, also clarified a bit the error message
https://build.opensuse.org/projects/hom ... 2/binaries

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 1:40 pm
by fehlix
abhidesh128 wrote: Fri Oct 18, 2024 11:30 am I edited mx.list to remove the extra forward slash and it solved my 2 issues:
  • It solved the download error with MXPI.
  • It solved issue with MX Repo Manager where it was unable to set another mirror.
Although, I am not sure how that extra / appeared in mx.list. This is a fresh install an I did not modify any apt settings. I was unable to do so because repo manager was not having any effect on mx.list. But, both of these issues have been solved now.
The reason for the doubled forward slash "//" within the mx-repo deb line's,
is actually an "typo" within the localization routine /sbin/localize-repo
used during LiveBoot_

Code: Select all

in_MX_HOST=https://mirror.kku.ac.th/mx-packages/mx/
That's the only one MX repo-line which ends with /mx/, end creates such
a deb-repo line shown with the QSI:

Code: Select all

  Active apt repos in: /etc/apt/sources.list.d/mx.list
    1: deb https://mirror.kku.ac.th/mx-packages/mx//repo/ bookworm main non-free
    2: deb https://mirror.kku.ac.th/mx-packages/mx//repo/ bookworm ahs
And b/c of "/mx/repo" is used as a search pattern
within MX Package Installer and MX Repo Mananger, would fail due to the
unfortune typo with that line.
One potential "workaround" besides editing manually mx.list ( /etc/apt/sources.list.d/mx.list )
in order to remove the extra forward slash would be to reset orignal apt sources
from within MX Repo Manager:
Restore_original_APT_sources.jpg
But note: The orignal apt-sources do not have "ahs" repo line enabled:
Restore_original_APT_sources_but_AHS.jpg
So you would re-select ahs-repo line again, and afterwards, select the MX repo from the MX Repo list to use.

Suggest, to get the ahs-repos enabled automatically when resettings APT repos,
at least in those cases where detection of ahs in use would be possible @Adrian

Also maybe would be nice to have localize-repo "fixed" in order to prevent snapshot's would re-create
those mx-repo lines with doublo-slashes "//" as well. @dolphin_oracle

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 3:11 pm
by Adrian
How would I detect if AHS were in use?

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 3:34 pm
by fehlix
Adrian wrote: Fri Oct 18, 2024 3:11 pm How would I detect if AHS were in use?
Only if current mx repo sources.lists would not be completely been out of order ("borked"),
something like as normal user - no root required.
Either query with apt:

Code: Select all

apt-get update --print-uris | grep -c _ahs_binary
or maybe just check whether some ahs binary lists (still) exist

Code: Select all

ls -d /var/lib/apt/lists/* | grep -c  _ahs_binary
would be greater zero, if ahs is currently been enabled.
Sure if neither lists exist or no valid line found in sources lists, this would not help anyway.
But at least this would keep the ahs line after reset, otherwise ahs line reverts always to get disabled.
+++EDIT+++ adjusted typos

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 3:52 pm
by Adrian
I seem to have a question that is supposed to pop up of mx_version >= 19 and of x86_64, doesn't this work?

Code: Select all

    // For 64-bit OS check if user wants AHS repo
    if (mx_version >= 19 && shell->getOut("uname -m", true) == "x86_64") {
        if (QMessageBox::Yes
            == QMessageBox::question(this, tr("Enabling AHS"), tr("Do you use AHS (Advanced Hardware Stack) repo?"))) {
            shell->runAsRoot(R"(sed -i '/^\s*#*\s*deb.*ahs\s*/s/^#*\s*//' /etc/apt/sources.list.d/mx.list)", true);
        }
    }

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 3:57 pm
by fehlix
Adrian wrote: Fri Oct 18, 2024 3:52 pm I seem to have a question that is supposed to pop up of mx_version >= 19 and of x86_64, doesn't this work?

Code: Select all

    // For 64-bit OS check if user wants AHS repo
    if (mx_version >= 19 && shell->getOut("uname -m", true) == "x86_64") {
        if (QMessageBox::Yes
            == QMessageBox::question(this, tr("Enabling AHS"), tr("Do you use AHS (Advanced Hardware Stack) repo?"))) {
            shell->runAsRoot(R"(sed -i '/^\s*#*\s*deb.*ahs\s*/s/^#*\s*//' /etc/apt/sources.list.d/mx.list)", true);
        }
    }
Not if I have an empty or otherwise completely messed up mx.list. So “reset” should reset and not rely on what crap is currently in mx.list
+++EDIT+++
Or, at least if _ahs_ was detected no need to ask further.

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 4:16 pm
by Adrian
That's prompted after the list is restored, user is prompted to enable it or not... since the detection seem unreliable I think in the seldom cases people need to restore their sources they should be able to respond to a simple question if they want or not to enable AHS sources.

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 4:32 pm
by fehlix
Adrian wrote: Fri Oct 18, 2024 4:16 pm That's prompted after the list is restored, user is prompted to enable it or not... since the detection seem unreliable I think in the seldom cases people need to restore their sources they should be able to respond to a simple question if they want or not to enable AHS sources.
Not needed if ahs is detected.
Try it: Reset, and enable ahs. Now reset again. Why do you want bother people to ask whether they want ahs, if ahs is clearly detected already?
Also the detection of ahs is very reliable apt's print-uris will tell, and clearly lists identfied components like ahs as such, and no network required to query.

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 5:21 pm
by Adrian
@fehlix I pushed the change to the repo https://github.com/MX-Linux/mx-repo-man ... 050358eb43

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 7:21 pm
by fehlix
Adrian wrote: Fri Oct 18, 2024 5:21 pm @fehlix I pushed the change to the repo https://github.com/MX-Linux/mx-repo-man ... 050358eb43
maybe, the ahs-check and enabling the ahs-deb line, would be better done on the extracted mx.list within the tempdir
- before the move - otherwise after moving orig mx.list the ahs-check always fails - and ahs would be kept disabled.

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Fri Oct 18, 2024 9:12 pm
by Adrian
You just said:
the detection of ahs is very reliable apt's print-uris will tell, and clearly lists identfied components like ahs as such, and no network required to query.
Which is which...

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Sat Oct 19, 2024 9:25 am
by fehlix
Adrian wrote: Fri Oct 18, 2024 9:12 pm You just said:
the detection of ahs is very reliable apt's print-uris will tell, and clearly lists identfied components like ahs as such, and no network required to query.
Which is which...
I'll have a look .. there is something else ... :snail:

Re: MX Package Installer has a difficulty writing file in /tmp

Posted: Sat Oct 19, 2024 5:06 pm
by fehlix
OK, now with some more "fixes" , so it will handle existing double slashes when changing repos (I know localize-repo is now fixed - but anyway) also only prompts for AHS repo, if not already detected it is in use or not, i.e. only in cases user removed mx.list or completely commented out all lines, or otherwise no mx-repo was enabled.
Send PR @Adrian