1,095 questions
2
votes
0
answers
100
views
Cannot get Git exit code with Powershell script in Jenkins
In a Jenkins script, I do :
def status = powershell(
script: """
# Display current directory
Write-Host "Current directory: \$(Get-Location)"
# ...
1
vote
2
answers
123
views
PowerShell Start-Process wrapper always fails and doesn’t capture child exit code
I'm using a setup.ps1 script to launch a (bunch of) child PowerShell scripts each from a new PowerShell process and tries to capture the script's exit code to determine if it succeeded using a helper ...
2
votes
2
answers
161
views
why this bash script works?
git diff normally will not generate an output, if the two commits it compares are identical, to make it generate explicitly "the two commits are the same", I found the bash script below.
...
1
vote
1
answer
105
views
pytest catching SystemExit, but exc_info.value.code is not the actual integer exit code
When using pytest and verifying that sys.exit was called,
the ExecutionInfo object attribute "value.code" does not reliably contain the genuine integer exit code.
The "value.code" ...
1
vote
0
answers
74
views
Can’t run SLURM batch script (ExitCode 127) when calling external qiime.sh
I’m submitting a SLURM batch script that calls an external shell script (qiime.sh), but SLURM fails with ExitCode 127 (“command not found”) even though the script runs fine manually. I need help ...
2
votes
1
answer
76
views
Python multiprocessing.Queue strange behaviour
Hi I'm observing a strange behaviour with python multiprocessing Queue object.
My environment:
OS: Windows 10
python: 3.13.1
but I observed the same with:
OS: Windows 10
python: 3.12.7
and:
OS: ...
0
votes
0
answers
25
views
Selenium Command in pycharm that formerly worked, giving exit code 0 no longer works properly, giving exit code 1
Selenium command when it was working
Selenium command when it stopped working
I've attached the selenium command to open google chrome when it was working. Here is a snippet:
from selenium import ...
0
votes
1
answer
145
views
What does the OS do when the EXIT code of a program is not given. C code example [duplicate]
so I have this C code that compiles (without warning flags enabled):
#include <stdio.h>
int main()
{
printf("output\n");
}
I was wondering what the OS would interpret by this?
...
2
votes
2
answers
203
views
Getting an exit code from powershell file invoked in C#
I am trying to have a powershell script called from a C# program give me the exit code of the powershell script. I have attempted it a few ways with no success. The PSObject from the invoke call ...
0
votes
0
answers
26
views
How to mark low of entry candle as stoploss in pine script
I have written a code (it is very basic code related to ema cross). I just wanted to set low of entry candle as stoploss and double of entry candle span as target. I tried reading guide /library but I ...
0
votes
1
answer
68
views
Python library pydub, exit code -1073741819
I am making a program where I need to play files many times. When I play a file, it plays, but after 2 seconds the program closes with exit code -1073741819.
Code: "
from pydub import ...
0
votes
1
answer
50
views
SSH does not return exit code of last command
I exexcute
$ ssh remotehost "exit 1"
$ echo $?
0
The result is 0 and not 1.
I have read here on stackoverflow, that it should be 1. What is going wrong? TIA!
Update (Solution):
ssh is a ...
2
votes
0
answers
61
views
How to read the stderr of a program if it exits with code 134
I have a (buggy) C program that exits with exit code 134 (abort). It behaves like the following:
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdint.h>
...
2
votes
1
answer
139
views
Why is Bash errexit (`set -e`) not passed into command substitution `$()` subshell, but is passed into `()`-subshell
I'm struggling with why an errexit a.k.a. set -e is not passed into a command substitution subshell (invoked with $(my-command) or backticks), but it is passed into a regular subshell (invoked with (...
2
votes
1
answer
151
views
How to get exact exit code that a snakemake job exited with?
When a snakemake job errors with a non-zero exit code, snakemake prints:
(one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)
Exiting because a job ...
-2
votes
2
answers
139
views
The exit code -1073741819 in clion in C language [duplicate]
I've been trying to build the practice code, but after the step(to get the cordinate through scanf function)
#include <stdio.h>
#include <math.h>
#define pi 3.1415926535
struct point {
...
1
vote
1
answer
52
views
How to get return code of command run before bash script?
$ beep; echo $?
Command 'beep' not found, but can be installed with:
apt install beep
Please ask your administrator.
127
$ cat test.sh
#!/usr/bin/env bash
echo $?
The expected output of my script ...
1
vote
0
answers
113
views
exit status of if statement in bash when condition is false
If I run help if in bash then it tells me that the exit status is "the status of the last command executed". Let's try it:
if false; then
echo we never get here
fi
echo $?
The last ...
0
votes
0
answers
61
views
Why does GDB exit with code 134 and not Code::Blocks?
#include <iostream>
#include <vector>
using namespace std;
long long n;
long long s;
int main(){
cin>>n;
vector<long long>a(n);
for(int i=1;i<=n;i++){
...
0
votes
1
answer
166
views
Docker compose up - my command is not failing despite non-zero exit status?
Within my team's CI/CD pipeline, we have the following Make recipe:
test-some-service:
echo "Running some tests...." && \
docker-compose up service-target-test && \
...
3
votes
1
answer
131
views
Why does a Bash while loop result in PIPESTATUS "1" instead of "0"?
GNU bash, version 5.2.15(1)-release (x86_64-pc-linux-gnu)
Consider this simple while loop:
while false; do true; done; echo "${PIPESTATUS[0]}"
It prints 1 instead of 0. This is unexpected ...
0
votes
0
answers
801
views
The preLaunchTask 'C/C++:gcc.exe build active file' terminated with exit code -1 Error
When I tried to run this C code in Visual Studio Code:
#include <stdio.h>
int main() {
int num, i = 0, lowest;
int array[10];
while(i != 10)
{
printf("Please ...
2
votes
0
answers
80
views
It is possible to detect a crash of the Java VM on its exit code?
Is there a specific exit code of the Java VM that returns if the Java process crash? I want restart the Java process if its terminate through an crash. If there is a normal termination for example ...
0
votes
0
answers
342
views
Clion Process finished with exit code -1073741819 (0xC0000005) problem
I reinstalled JetBrains Clion and an error started appearing
Process finished with exit code -1073741819 (0xC0000005) when running this code:
#include <iostream>
#include <stdio.h>
using ...
0
votes
0
answers
255
views
On VScode, why does my code immediately execute a exit code=1? [duplicate]
I am new to coding and was given an assignment to make a program that manages a banking account. I wrote and run my program on VSCode and it immediately initiates an exit code=1 and showed these ...
0
votes
0
answers
239
views
"The terminal process "/usr/local/bin/bash '-l'" terminated with exit code: 1."
When I open the bash terminal in VScode it immediately closes and I get the following error: "The terminal process "/usr/local/bin/bash '-l'" terminated with exit code: 1.". I have ...
1
vote
1
answer
905
views
java Process returns exit code 35 on first iteration only
I am calling curl with a java Process to send json text to an API. I call this code in a loop and all the updates work, except the first one, which fails with exit code 35. I believe the error code ...
-1
votes
1
answer
97
views
Python program works with test cases but PyTest fails. How can I understand the issue?
I am new to Python and PyTest. I wrote a program that calculates the lines of code from another Python file. The source code is the following:
import os.path
import sys
def main():
print(...
0
votes
1
answer
168
views
How we can define Enter and Exit block to conenct the main flowchart in any logic?
enter image description here
How we can connect these two flowcharts together?
in order to complete the main flowchart we want to insert the flowchart which starts by Enter and finishes by Exit.
we ...
6
votes
3
answers
6k
views
Is there a standard set of exit code numbers for C/C++?
AFAIK, the exit code numbers may vary depending on the application and the conventions adopted in a project. However, I wonder if there is an exit code standard list for C/C++ projects.
1
vote
0
answers
354
views
wicked_pdf libssl.so.1.1 cannot open shared object file, no such file or directory
I installed my repo on a new machine, and now getting this error during wicked_pdf
Rendered user_mailer/base.pdf.erb (3102.9ms)
[wicked_pdf]: ["/usr/share/rvm/gems/ruby-2.4.1@asdf/gems/...
0
votes
1
answer
145
views
Is there supposed to be "iptables-restore < /etc/iptables.ipv4.nat" before an exit 0 statement?
I am trying to set up an access point via Raspberry Pi 2 and a USB WiFi adapter AWUS036H, made by Alfa Network. I am following a guide. The guide is not clear on step 9 whether or not "iptables-...
1
vote
1
answer
159
views
Why does adb return zero exit status in case of "failed to connect"?
Why does adb return zero exit status in case of "failed to connect"?
Demo:
$ adb connect 123.123.123.123:123
failed to connect to '123.123.123.123:123': Connection refused
$ echo $?
0
Is it ...
1
vote
0
answers
58
views
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV) - How can I solve this issue with my code below?
What could be causing this issue?
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
Here is my script:
import googlemaps
import webbrowser
from ortools.constraint_solver import ...
0
votes
0
answers
53
views
Process finished with exit code -1073740940 (0xC0000374). Python [duplicate]
I'm encountering an issue while trying to run my Python project on Windows 10. The process finishes with exit code -1073740940 (0xC0000374). I've attempted reinstalling dependencies, cloning the ...
1
vote
1
answer
619
views
Getting exit code from the application running in a container (kubernetes)
I am trying to get the exit from the application running in a kubernetes cluster. I can see the pod status as Error but I am interested in getting the exact exit code.
Docker File:
# getting base ...
1
vote
1
answer
701
views
What causes exist status 2 error? (GOLang)
Got this long error when running a simple Go program. Here's my main.go, which has all the functions in a single file (vscode was giving me errors otherwise, even though all files were using package ...
0
votes
1
answer
284
views
Why does my shell script register a successful exit when it fails?
I have a shell script that executes whisper on all files in a directory on a network device, and then stores the resulting transcript on the same volume. Sometimes something happens with the network (...
0
votes
0
answers
44
views
exit code bash commands env and pwd with an invalid option [duplicate]
These two errors are not treated in the same manner.
One has told me that env is not a builtin in bash.
Why the exit codes are different ?
pwd -y
bash: pwd: -y: invalid option
echo $?
2
env -y
env: ...
2
votes
1
answer
168
views
Fail bash script when command expansion fails
I'd like to be able to warn and fail if the following command expansion fails:
#!/usr/bin/env bash
set -Eeuo pipefail
echo "$(invalid_cmd)"
echo "$?"
Instead of failing, I get ...
-2
votes
2
answers
224
views
How to exit a bash script if the c++ compiler finds an error?
I am using a bash script that does the following:
makepp
./mainHeu
where makepp is used to run a c++ code that returns the executable ./mainHeu.
I would like to stop the bash script before ./mainHeu ...
1
vote
1
answer
691
views
Python process ends with exit code -11 when trying to play audio
I'm trying to write a program for a raspberry pi 3b in python that plays a random loaded .wav file when an on board button is pressed, but it gets to the point of attempting to play the sound then ...
1
vote
3
answers
125
views
Can I make bad [ syntax in a bash if statement cause the shell to exit with an error?
Consider the following bash code:
if [ "$a" = "foo"]
then
echo "TRUE"
fi
echo $?
we get:
bash: [: missing `]'
0
So basically, the test in the if fails due to a typo (...
1
vote
1
answer
177
views
How to set / read shell variables in Jenkins
I'm teaching myself Jenkins and am trying to direct execution flow of a 'pipeline job via declarative syntax' based on result of Test Stage, which I try to implement via the pytest exit code into a ...
1
vote
1
answer
42
views
Can git diff report the exit code of an external diff program?
I know git diff can report a diff-like exit code, using the --exit-code option. However, I haven't found a way to make this play nicely with an external diff program. That is, I would like the ...
0
votes
1
answer
643
views
Catching the correct error code in Python and PowerShell
I am running a Python FastAPI app with 4 different APIs. In the first one, I have implemented an error handling which after some trouble is working somehow fine. So I copied it's structure to the ...
0
votes
0
answers
78
views
debugging terminates when adding gmp.h library
i appreciate it if you would help me with this problem which i am struggling since 2 days.
i am using vs code and c.
i am trying to do some calculation on floating integers with more than 10 digits ...
3
votes
1
answer
118
views
Bash if statement expression evaluates to FALSE but $? is 0, why?
The example below echoes 1, as expected:
test -f /usr/bin
echo "$?" #1
Why does the following example echo 0?
if [[ -f /usr/bin ]]; then
echo "Inside if statement" # This line ...
1
vote
0
answers
504
views
How to check the exit code of a Docker container run with the Jenkins Docker pipeline plugin `withRun()` method?
In my Jenkins pipeline, I run a Docker container.
To take advantage of the automatic cleanup (stopping the Docker container), I use the Jenkins Docker plugin pipeline's withRun() method to run the ...
1
vote
0
answers
231
views
subshell command and capturing the exitcode
in python3 i invoke a parent shell with subprocess.run:
output=subprocess.run(['parent.sh', *cmd], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
then i check the returncode:
print("retcode =&...