Questions tagged [error-handling]

Use this tag for questions on how to handle errors generated in shell scripts.

Filter by
Sorted by
Tagged with
-2 votes
0 answers
7 views

Python script There is no error but still not working

def mathematics_expression(): num1 = int(input("Enter First Number: ")) num2 = int(input("Enter Second Number: ")) print("Enter which operation would you like to perform?&...
user avatar
0 votes
0 answers
26 views

errno vs errors returned by library functions [migrated]

For errno, there are a bunch of library functions, like strerror(), etc. to convert or print the error code. But what about the error codes returned by library functions? E.g. write() will return ...
user avatar
  • 399
-2 votes
1 answer
30 views

New user is having trouble installing mint and getting connected to internet [closed]

0 After the asus boot screen I click on file to install Linux mint 20.3 after I click it this always comes up (see pic) Another problem I’m having is that I can’t seem to get my computer online(2 and ...
user avatar
0 votes
1 answer
24 views

How can I check if the first command on a pipe gets an error?

Let's say I execute the following command on a terminal: this-command-doesnt-exist-and-closes-with-code-127 | jq '' If I execute echo $? I'll get 0 as result because it's checking the exit code from ...
user avatar
  • 309
0 votes
0 answers
18 views

im trying to install backports in my kali linux but im getting an error while using the code line " make list-defconfigs"

im trying to install backports in my kali linux but im getting an error while using the code line " make list-defconfigs".screenshot I have done both apt update and upgrade and search ...
user avatar
1 vote
0 answers
31 views

Permission denied: Linux KVM Share

When I tried to start the VM I get the following Error (Note, the host is a OpenSUSE Leap 15.3): Traceback (most recent call last): File "/usr/share/virt-manager/virtManager/asyncjob.py", ...
user avatar
  • 21
0 votes
1 answer
67 views

Can redirecting stderr and stdout to one file result in an error?

I'm writing a script that takes files (filename...) as arguments, and redirects both the stdout and stderr to a file of name filename.output. In the files are commands, and I'd only like to bash once (...
user avatar
  • 3
1 vote
0 answers
25 views

Cant install Selinux policy

I am trying to install selinux on my librem14 pureos machine, every time I run sudo apt-get install selinux-policy-default I get: dpkg: error processing package selinux-policy-default (--configure): ...
user avatar
  • 11
1 vote
0 answers
161 views

rclone android (Termux) error: "Fatal error: failed to mount fuse fs: fusermount: signal: bad system call"

I'm in the middle of trying to mount my OneDrive cloud files to my android phone via Termux v0.118.0. I've been able to install rclone and link my remote drive to the phone, where I can confirm ...
user avatar
  • 187
1 vote
1 answer
652 views

Debian: The repository CDROM does not have a Release file

I have just finished installing Debian on my laptop; I had to add manually the drivers for my WiFi card after the installation, I simply installed them via sudo apt ./name.deb, where name.deb is a ....
user avatar
  • 173
0 votes
0 answers
219 views

python script error

Recently, I redownloaded kali linux version 2021.4. I did the normal set up command "sudo apt update && sudo apt upgrade". After I finished the update I proceeded to copy a github ...
user avatar
  • 101
-1 votes
1 answer
93 views

How to deal with Linux error: for 'ping', 'cannot execute binary file'

/home/$USER/bin/ping: cannot execute binary file: Exec format error $ uname -a Linux $USER 5.13.0-22-generic #22-Ubuntu SMP Fri Nov 5 13:21:36 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux Ping reinstall ...
user avatar
0 votes
0 answers
104 views

Undefined reference to libraries while building

I am trying to install tgs2apng in Ubuntu on WSL. As instructed I installed the 3 libraries- rlottie, libpng and apngasm. However When I run make I get undefined references to rlottie and apngasm Here'...
user avatar
0 votes
0 answers
20 views

System locking up upon shutting down

Today upon shutting down my System I was greeted with loads of errors and informations i do not understand. This happened yesterday also and it didn't seem to continue to shut down "normally"...
user avatar
  • 13
0 votes
0 answers
50 views

Steam cannot launch on POP!_OS

I recently installed POP!_OS, and have had a good install up until trying to use steam. I downloaded it from the package manager, and am getting these errors every time I try to start it. Originally I ...
user avatar
14 votes
4 answers
2k views

Need the exit code of condition function when a Bash "while" loop terminates

I'm trying to get the exit code of the function that I'm repeatedly calling in the "condition" part of a Bash while loop: while <function>; do <stuff> done When this loop ...
user avatar
  • 502
0 votes
1 answer
49 views

bash debug options?

It seems to me (and correct me if I'm wrong please) that bash is quite bad at error messages that correctly tell you where the problem in your script is. For example, often I will get "bad EOF at ...
user avatar
  • 559
0 votes
1 answer
45 views

What does this bcf error mean?

I ran this code to filter out biallelic variants from my vcf file: bcftools view --max-alleles 2 --exclude-types indels merged.ecDNA.vcf.gz>merged.ecDNA2.vcf.gz However, I got an error message: [E:...
user avatar
0 votes
0 answers
818 views

How to update the sorces list on Pop!_OS?

I am trying to install and update my apps on Pop!_OS 21.04 but it keeps on saying that connection failed or the file has not yet been released. This only happens when I install files from http://us....
user avatar
0 votes
0 answers
28 views

speech recognition and translate check URL

Can someone help me to check the links in the script if they work or there are new links in the meantime? We have to check in all script the links, adjust and then test the script.. I have Google API ...
user avatar
0 votes
0 answers
46 views

Sub-process returned error code (1), low boot memory

System specs: OS: Pop!_OS 20.04 It appears that my boot partition is running low on memory, and frankly, not entirely sure what or how that happened. I have some suspicions, but I feel like I'm ...
user avatar
1 vote
1 answer
800 views

Connman error "passphrase required", but not making me input password

So I wanna connect to a wifi network, I click it and it doesn't show the window to input the password. It just shows this error: "GDBus.Error:net.connman.Error.PassphraseRequired: Passphrase ...
user avatar
1 vote
1 answer
365 views

Retry a maximum of 10 times scp command until it succeeds

I wish to retry scp 10 times and print an error message if it failed. Below is my code: #!/bin/bash FILE=$1; echo $FILE; HOMEDIR="/home/ibro"; tries=0; while (system "scp -P 3337 $FILE ...
user avatar
  • 297
0 votes
1 answer
153 views

When I need to make Firefox and brave run as root and transfare Xauthority this error appear

When I tried to run this command line cp -a /home/root1/.Xauthority .Xauthority ` this error appear, What the reason is? cp: cannot stat '/home/root1/.Xauthority': No such file or directory please,...
user avatar
0 votes
0 answers
43 views

Syntax errror near unexpected token '}'

Good evening, I am trying to create a script to approximate the value of sine with the taylor series in UNiX However I have a message error, syntax error. I unfortunately cant find where is the error ...
user avatar
0 votes
0 answers
109 views

Npm won't install SOCKET.io due to Node version?

I need to install socket.io for my node program. So, whenever I try to install socket.io by running the following commandline instruction, it says node version needs to be greater than or equal to 10 ...
user avatar
  • 133
0 votes
2 answers
155 views

Error output from ls -A results in error output, why?

I have a script I run regularly using cron. I would like to get notified by email when these scripts fail. I do not wish to be notified every time they run and produce any output at all. As such, I am ...
user avatar
  • 161
0 votes
1 answer
377 views

Linux tar: You may not specify more than one tar '-Acdtrux', '--delete' or '--test-label' option

I am trying to install the latest Node on my Linux system by running the following terminal command, I keep getting the following error. tar: You may not specify more than one '-Acdtrux', '--delete' ...
user avatar
  • 133
0 votes
1 answer
993 views

Grub rescue error (insmod normal)

I was trying to make it normal from grub rescue error. But, msdos7 is returning that filesystem is ext2. When I write insmod normal I get "invalid file name 'hd0,msdos7/i386-pc/normal.mod" ...
user avatar
0 votes
0 answers
14 views

I am trying to install MCScanX-transposon but it says makefile not found

I am trying to install MCScanX. MCscanX was installed successfully but I am getti9ng error while installing MCScanX-transposon. When I write make, it says no target specified. I also tried ./configure ...
user avatar
  • 1
1 vote
1 answer
598 views

How do I access "netdev_dbg" logs?

I'm trying to debug my device which uses the qc7000 driver (qca_spi.c) It has a bunch of useful netdev_dbg messages scattered around. How can I access the logs where these messages are being stored?
user avatar
  • 135
0 votes
1 answer
27 views

mint boot error multiple times

I earlier was having an issue. I had solved that also. But, I am facing it again. Same issue. Same error. It's been three times I have faced the issue. I had solved the issue same way every time. But, ...
user avatar
0 votes
1 answer
60 views

chroot error : "I: arm64 cannot be executed, falling back to qemu-user"

I set up a arm64 chroot named via this command: sudo mmdebstrap --architectures=arm64 buster myArm64Machine entered said chroot with command below: sudo chroot gnome-core-arm64 myArm64Machine one of ...
user avatar
  • 79
2 votes
2 answers
106 views

How to choose an appropriate error prefix? [closed]

How can I figure out appropriate error prefixes to use when reporting various kinds of errors? Is there are guideline or overview of how these should be? I see patterns in many commands, but find it ...
user avatar
0 votes
1 answer
621 views

Failed to fetch archive in apt

I am getting the below error while trying to install RSS software Liferea Evolution Facing problem for both. But I want only one. Error code: 404 Not Found [IP: 43.255.166.254 80] Fetched 10.6 kB ...
user avatar
  • 1
0 votes
2 answers
89 views

how to fail on first error when using bash as a template tool

I am looking for a better version of set -e. That better version should just work™. I briefly read BashFaq/105 and tried this insane approach, but I still do not know how to fail on error. My use case ...
user avatar
  • 101
-1 votes
2 answers
1k views

prevent error if file does not exist

I need to get the contents of a file but want to prevent an error if it does not exist. Is it possible to do something like this? cat my-file.txt || false
user avatar
  • 1,657
3 votes
2 answers
832 views

got "tar: /path/to/my/dir: Not found in archive" error while verifying created archive

I did compress a directory to .tar.xz archive format with this command: tar --create --verbose --file myArchive.tar.xz /path/to/my/dir then,I tried to check health of created archive with following ...
user avatar
  • 79
0 votes
0 answers
159 views

linux non recognize usb hdd

First of all thank you for the help, and my apologize because I don't have a deep knowledge on this kind of things. I've a Toshiba StoreE HDD USB drive that don't want to work. When I use dmesg shows ...
user avatar
  • 1
0 votes
1 answer
2k views

Why am I receiving the "zsh: exec format error: ./metal" error?

I am attempting to run a Unix executable program (Metal; https://genome.sph.umich.edu/wiki/METAL_Quick_Start) from the terminal. I continue to get the following error: zsh: exec format error. I have ...
user avatar
0 votes
1 answer
3k views

Tar: File changed as we read it/ file removed before we read it Errors

I'm trying to create an automated backup script using the tar command: tar -czg /home/user/BackupArchiv/snapshots/snapshot_2020-10-12 -f /home/user/BackupArchiv/backup_2020-10-12/backupfull.tar.gz /...
user avatar
  • 17
-4 votes
2 answers
353 views

Is it possible to pipe only on error? [closed]

If there is any error then 2>&1 and pipe (|) to another program, otherwise do not 2>&1 and do not pipe
user avatar
4 votes
1 answer
443 views

subshell not propagating error, bash 4.4

I have this in a github workflow - run: bash --version - name: run postgres run: | set -e shopt -s inherit_errexit export ID=$(docker run \ ...
user avatar
0 votes
1 answer
43 views

Error: "/bin/sh: 1: /usr/local/lib/node_modules/wasm-opt/out/wasm-opt: not found" returns with exit status 0!

So I borked an installation of a bin, and when I try to run the command (wasm-opt input_file.wasm) I get this: /bin/sh: 1: /usr/local/lib/node_modules/wasm-opt/out/wasm-opt: not found But that ...
user avatar
  • 131
1 vote
1 answer
638 views

Search for a string in all searched files gives /bin/grep: Argument list too long error

I tried the below command to search for in all files user /var sudo find . -type f | xargs sudo grep 202007602 | tee /tmp/202007602.log Output: grep: ./www/html/jenkins/workspace/node_modules/xpath/...
user avatar
  • 297
2 votes
0 answers
20 views

Script configuration issues

My purpose is to allow user A to run a specific script owned by user B but with user B’s profile loaded. This is on a Solaris maachine. I have users A and B, I set this line: in the sudoers file, so ...
user avatar
0 votes
1 answer
63 views

how to suppress error message in Unix for apache

I know that we can suppress error message when the command is ls ls /usr/tbin/httpd || /home/app/httpd/bin/apachectl 2>/dev/null However, i want to suppress No such file or directory for the below ...
user avatar
  • 297
-9 votes
1 answer
101 views

apt-get update error [duplicate]

root@kali:~# apt-get update Get:1 https://mirror.karneval.cz/pub/linux/kali kali-rolling InRelease [30.5 kB] Reading package lists... Done E: Release file for https://http.kali.org/kali/dists/...
user avatar
2 votes
0 answers
48 views

Why does trap not get triggered when sourcing a file that does not exist?

#!/bin/bash set -eEuo pipefail set -x function deploy_cleanup(){ echo "---Cleaning up---" echo "hello" } trap deploy_cleanup ERR whoami source euaueoaue Outputs: + ...
user avatar
5 votes
2 answers
925 views

How to continue cascaded pipeline commands after a failure

I am running a command and manipulating the output with my own script, but I don't want the main command to stop when my script fails. For example: a-command | tee logfile.txt | myscript when my ...
user avatar
  • 163

1
2 3 4 5
7