Questions tagged [error-handling]

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

Filter by
Sorted by
Tagged with
1
vote
1answer
26 views

hiding a file from sudo rm -rf * (or skipping)

I am trying to hide one new file from a script that contains 'sudo rm -rf *' - I am wondering if I can do this without redoing the script/ if this is possible or not. I have tried the following: $ ...
0
votes
1answer
6 views

fastcgi php nginx errorlog messed up

I have a strange problem, the errorlog of my nginx server is somehow messed up: PHP errors seem to be all written in one line and repeating itself recursively. This way the llog grows a few GB within ...
1
vote
1answer
71 views

Piping errors to my function causes command to be ignored after 1 failure

Context: I have a Bash Script that copies files function log () { read IN if [ "$IN" == "" ]; then : else echo "$datetime"$'\t'"$IN" | tee -a logfile fi } function ...
1
vote
1answer
47 views

Can't login to Kali after upgrade

I'm running Kali from VMware. I upgraded my Kali, and after rebooting I can't login. When I restart I'm login automatically via tty1 , and receiving the following error: uname : loadlocale.c:129 : ...
0
votes
0answers
29 views

Bash inconsistent behavior between echo / assigning a variable with `set -e` and subshell

#!/usr/bin/env bash set -euxo pipefail echo $(echo "$THIS_VAR_DOES_NOT_EXIST" | cat) echo "WTF" Running this script produces: ./wtf.sh ++ cat ./wtf.sh: line 4: THIS_VAR_DOES_NOT_EXIST: unbound ...
0
votes
0answers
27 views

Error downloading files from Google Drive and other errors with Google products

I'm running Linux Mint 19.2 Cinnamon and when I try to download a file from Google Drive (wheter it's my Drive or not) I always get an error that looks somewhat like this: I've tried anything: ...
0
votes
0answers
17 views

Ubuntu 19.10 has experienced an internal error

I faced this error after booting the system. And this error continues to persist, and leads to system crash eventually.
-3
votes
1answer
48 views

Run ./configure script as user under Alpine Linux

I’m trying to compile a program from source under Alpine Linux. When I run ./configure under root everything goes well, but when I do the same as a normal user I get: ./configure: This script ...
0
votes
1answer
42 views

Trying to install RuneLite on Manjaro, got this error trying to build

So I was trying to install RuneLite on Manjaro, and at first it built, but it wouldn't launch. I checked the faq on their github and it they said that it had to do with a bug with JDK 10+, and to just ...
3
votes
1answer
53 views

command substitution does not respect err_exit sometimes

I have a weird situation where inserting any command that succeeds in the line above makes command substitution ($(I mean this)) not work as expected — it does not exit, even though the command fails ...
0
votes
2answers
64 views

What’s the difference between providing input to a command via an argument to that command and providing input through a shell redirection operator?

When I use my shell’s redirection operator to provide a (non-existent) filename to the grep command, the error message about that file not existing is displayed by my shell. But when I provide that ...
0
votes
0answers
765 views

Couldn't get pcap handle, exiting

I got an error when i use wash tool to display the networks around me that has wps enabled. But i had an unexpected error while i'm trying to run that. root@Shadow:~# wash --interface wlan0 [X] ...
1
vote
1answer
21 views

How to prevent Pulseaudio failover on sink error

If I play music through a USB sound card in ALSA, and accidentally unplug the USB cable, then it stops playing automatically, making it easy to detect the problem and fix it: $ mpv --audio-device=...
0
votes
0answers
139 views

EADDRINUSE on every port in Node/Express.js event after restart linux

I am running node with express.js over it on Linux. It was working but now when I start my server the followng error is displayed: Error: listen EADDRINUSE: address already in use 0.0.0.0:1223. ...
0
votes
0answers
15 views

Attempting to write PHP array to file in Linux PHP interactive shell produces Uncaught Error and empty file

After executing the following commands: [root@server test]# php -v PHP 7.2.25 (cli) (built: Dec 17 2019 22:57:09) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.2.0, Copyright (c) 1998-...
0
votes
0answers
157 views

What does the error “undefined reference to 'dlopen'” mean?

When I want to compile my c-file I get these messages: undefined reference to 'dlopen' undefined reference to 'dlsym' In some other posts about this topic the solution was to add -ldl to the linker ...
1
vote
1answer
113 views

How can a command within a pipeline abort the pipeline?

Given the pipeline a | b | c how might I alter b so that it aborts the pipeline if b generates an error or matches a particular pattern in the input stream?
0
votes
2answers
88 views

How to troubleshoot a bash script called by a python script called by a program?

I have to troubleshoot this bash script called by a python script called by a program, all run in Ubuntu 18.04. The python script and the program are black boxes. The only information I have is that ...
0
votes
1answer
15 views

How does ALSA handle errors in isochronous USB data

USB transfers fixed data rate digital audio data using its isochronous mode. To ensure the fixed data rate, this mode has no provision for retries of faulty transmissions. How does ALSA handle ...
0
votes
2answers
92 views

Using an array of strings with spaces in bash - error messages “curl: could not resolve host”

I am attempting to write a script in bash that monitors certain aspects of a server, and sends a message to slack if it notices that something is wrong. However, I am running into a strange set of ...
0
votes
1answer
43 views

Umount: target is busy to variable

I want to check if a USB is busy and store the result in a variable: $ foo=$(umount /dev/sdb1) $ umount: /path/mounted: target is busy. But when I want to print $foo, I get an empty variable $ echo ...
0
votes
1answer
153 views

Cannot execute ld : error 126

I have f30 installed 3 weeks and I keep seeing this error when I try to compile C++ of maybe fortran code. It is an error connected to ld : error: ld returned 126 exit status I've tried to look into ...
1
vote
3answers
612 views

Getting the following error: -bash: 1: command not found when trying to execute for loop

When i try to execute the following command: for x in $(seq 10); do echo $($x >> c.txt); done I get the following error: -bash: 1: command not found
-2
votes
1answer
65 views

tar flexibility for -f

In the following command for example, tar -xzv works but tar -xzvf fails: wget ${target_url} -O - | tar -xzv --strip-components 1 -C ${web_application_root}/${domain} I understand I download a data ...
0
votes
0answers
63 views

Failed to run bash script remotely Too many )'s

After some research: Script to ssh and run a command doesn't work Multiple commands in sshpass Make a shell script execute commands in telnet or programs I've come up with a script that logs ...
3
votes
1answer
3k views

Program crashes with the error “Inconsistency detected by ld.so: dl-lookup.c: 111” (linux beginner)

This is my first time posting, so I'm sorry for any mistakes in formating or exposing the problem. I am also a Linux beginner. I am trying to run a bioinformatics program called Caver Analyst. ...
1
vote
2answers
772 views

System service running python code exit with error code status 1

_note: the original posted question is edited and its faced has changed quite a bit! Summary: A python script using apshceduler fails to load as service with exit code staus1. Important to note that ...
-1
votes
1answer
549 views

fatal error : linux/interrupt.h : no such file or directory

I am developing code for interrupt. When I am including #include <linux/interrupt.h>, I get fatal error : linux/interrupt.h no such file or directory Why am I getting this error and how can I ...
-1
votes
1answer
768 views

Issue using pip3 to install “face_recognition”, packages do not match hashes

When I give command pip3 install face_recognition in the raspberry pi terminal, It shows this error: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE. If you have updated the ...
0
votes
0answers
114 views

EDUP WIFI instllation in Reaspberry pi error

I need to install the Wifi dongle into my raspberry zero for connecting to my home wifi modem, based on solving my previous question vi this link: https://raspberrypi.stackexchange.com/questions/...
-1
votes
1answer
36 views

Why is this bash script read line code giving me errors? [closed]

Why is this bash script read line code giving me errors? read -p "Does this require cropping? (y/n)? " answer case ${answer:0:1} in y|Y ) mkdir cropped; for i in *.mp4; do ffmpeg -i "$i" -filter:...
0
votes
0answers
56 views

Bluetooth file transfer PC-to-Android fails

on sending a file from a debian machine to an android device over bluetooth using the blueman-sendto command it finishes with an error: _on_properties_changed (usr/lib/python3/dist-packages/blueman/...
0
votes
3answers
4k views

E: Unable to locate package nvidia-graphics-drivers-418

My OS is Deepin 15.10. My GPU is NVIDIA Quadro 3000M. I want to play games on Linux. Steam has a program called Proton which enables this. Proton requires nvidia-418 or higher to work properly, so I ...
0
votes
3answers
296 views

Handle specific error in bash

As a part of my script, I want to publish package to nuget feed: dotnet nuget push package.1.2.3.nupkg --source "mysource" --api-key "mykey" The command may print error: 409 already contains version ...
0
votes
1answer
848 views

Update Failed: Download failed. cURL error 6: Could not resolve host:

I am getting the error "Update Failed: Download failed. cURL error 6: Could not resolve host:"  on WordPress on my vps server...I have also noticed it in other applications as well. As a consequence, ...
0
votes
1answer
41 views

ls reports nonexistent files first, ignoring the specified order

$ ls -lU a.txt test.sh badtest ls: cannot access 'badtest': No such file or directory -rw-r--r-- 1 gqqnbig gqqnbig 11 Apr 15 17:17 a.txt -rw-r--r-- 1 gqqnbig gqqnbig 11 Apr 16 17:22 test.sh Although ...
0
votes
1answer
235 views

Debian sources errors

When I try to update my packages on my Chromebook (with Linux installed on it) I do this: sudo apt-get update, and it gives me this error: Ign:1 https://deb.debian.org/debian stretch InRelease Ign:2 ...
0
votes
3answers
154 views

Linux/Debian dpkg & administrator errors

So today I ran into a bunch of errors while using the sudo command on my Chromebook with Linux installed. For example when I try to remove my Google Chrome beta application, I tried this: sudo apt-...
3
votes
1answer
359 views

What are these three extra chars and why do they cause such a strange error? [duplicate]

Look at these two files: File 1 File 2 They look to me entirely identical, but File 1 has 41 bytes and File 2 has 44 bytes. Now, I would not care about 3 extra chars, however, I think these chars ...
2
votes
1answer
370 views

Checking for invalid date in bash script

I am checking for a valid date scrpt.bash test 2019-05-03 date -d $2 2>: 1>:; c=$? If $c is 1 then the date is invalid. If I enter 2019-05-03 I will get a 0 which is correct. If i enter 2019-...
6
votes
1answer
8k views

fontconfig warning: “/etc/fonts/fonts.conf”, line 100: unknown “element blank”

Getting this error on my vps server: fontconfig warning: "/etc/fonts/fonts.conf", line 100: unknown element "blank" This is the file: https://pastebin.com/VqcSgJ9x How to fix it?
0
votes
0answers
346 views

how to make a Input/Output Error example?

I'm working on a simple game console for raspberry pi, and I want to handle some common errors like segmentation fault, arithmetic exception and input/output error (since there maybe some guys using ...
2
votes
1answer
100 views

Why does trap ERR behaviour differ over bash versions 3 and 4?

Background Execute the following code in bash 3, 4 and 5 respectively, and you will get differing results. (function handle_error () { echo ERROR; }; trap handle_error ERR; (exit 1)) Imagine that (...
0
votes
1answer
157 views

clang: error: no such file or directory: '_REENTRANT'

I am trying to install UDUNITS-2 package for the graphical visual browser: ncview. I need to understand the following error message: clang: error: no such file or directory: '_REENTRANT' A similar ...
2
votes
1answer
402 views

Failing on errors inside a function which is called on the left-hand-side of an && expression

I am working on a Bash script with several functions. I would like to exit the script if any commands return an nonzero exit code, unless in a context where that code is being explicitly handled (such ...
0
votes
1answer
608 views

How to run Ansible playbooks only if there are no problems in the playbook?

I have learned of the command ansible-playbook example.yml --check which can tell me if something in my playbook is problematic (as far as Ansible can recognize). I think I should combine this ...
6
votes
3answers
1k views

How can I output a command to a file, without getting a blank file on error?

I'm trying to run a command, write that to a file, and then I'm using that file for something else. The gist of what I need is: myAPICommand.exe parameters > myFile.txt The problem is that ...
0
votes
4answers
87 views

How to debug my script?

This script name is hello for i in $(ls $*);do x=$(echo $(basename $i".md")); pandoc $i -t "latex" -o $x.pdf; done When I write this $ ./hello *bye.md This error ls: cannot access 'test': ...
1
vote
0answers
1k views

Error adding symbols: DSO missing from command line while compiling Ogre Meshy

Yes I read many questions for ex. this and this and this and this but nothing works for me. So basicaly Im trying to compile Ogre Meshy but Im getting an error [100%] Linking CXX executable bin/...
1
vote
0answers
1k views

Yum not found on Centos 7 “ No module named yum”

I recently installed CentOS 7 but have run into an issue with yum. I get the following error: There was a problem importing one of the Python modules required to run yum. The error leading to this ...

1
2 3 4 5