im getting error code 127 while creating jenkins pipeline here is the script - jenkins-pipeline

pg_dump -h 10.12.0.4 -U pet--rsmb--prod-l1--usr -w -c -f 2022-08-10t1228z-data.sql
/var/lib/jenkins/workspace/BACKUP-RSMB--POSTGRESQL#tmp/durable-510acc0f/script.sh: 1: /var/lib/jenkins/workspace/BACKUP-RSMB--POSTGRESQL#tmp/durable-510acc0f/script.sh: pg_dump: not found

Your error clearly indicates that the Shell executor cannot find pg_dump command. Either you have not set pg_dump properly in the Jenkins server or you have not added pg_dump to the executable $PATH.

Related

Trying to curl on rancher pod start up but unable to curl

Currently trying to make an init container on rancher which will send a curl to one of my services. I am having repeated issues trying to get this work and I cannot pinpoint why. I am certain my yaml format is correct and I am installing busy box so curl should be available for use
You are missing the -c option for the shell to tell it that it should read commands from the command line instead from a file:
sh -c curl -X POST ...
So you have to put -c as first container arg:
...
- args:
- -c
- curl
- -X
...

FRM-91500: Unable to start/complete the build when trying sudo su - oracle -c to run frmcmp_batch.sh

I was trying to automate our form compilation process.
I created a .bat file that will do the following:
Login user to host
sudo -S -u oracle bash -c 'bash /frmcmp_batch.sh'
But when I try to run frmcmp_batch.sh, I'm getting the error:
FRM-91500: Unable to start/complete the build error.
It is because your display isn't right. You get this to work by setting the following commands:
export TERM=vt220
export ORACLE_TERM=vt220

Kubectl: get a shell to a running container under Windows

I'm trying to log into running container using Kubectl, according to instructions in https://kubernetes.io/docs/tasks/debug-application-cluster/get-shell-running-container/, but I'm failing miserably:
kubectl exec -it mycontainer -- /bin/bash
Unable to use a TTY - input is not a terminal or the right kind of
file rpc error: code = 2 desc = oci runtime error: exec failed:
container_linux.go:247: starting container process caused "exec:
\"D:/Applications/Git/usr/bin/bash\": stat
D:/Applications/Git/usr/bin/bash: no such file or directory"
command terminated with exit code 126
It looks like kubectl tries to exec bash on my machine, which is totally not what I want to achieve.
I can exec commands without spaces:
$ kubectl exec mycontainer 'ls'
lib
start.sh
But with not:
$ kubectl exec mycontainer 'ls .'
rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:247: starting container process caused "exec: \"ls .\": executable file not found in $PATH"
command terminated with exit code 126
What I'm doing wrong?
I've tried both in mingw git shell , as with plain windows console.
Seems it might be related to this github issue.
One of the workarounds might be to use winpty as specified here.
winpty kubectl.exe exec -it pod-name -- sh
You can also try /bin/sh instead of /bin/bash it worked for me, but I do not have a Windows machine to check it in the same environment as you.
Below command worked for me to launch windows command prompt
kubectl exec -it mycontainer -- cmd.exe

Linux running a command inline to CURL command

I'm trying to run the file sh /usr/local/sbin/script.sh and assigning the stderr as parameter to $msg.
curl -k -X POST https://192.168.0.25/sims/index.php -d "option=com_user&task=sendSMSalert&msg=$(/usr/local/sbin/script.sh 2>&1)"
The above script works fine on Ubuntu but when running the same script on freenas 11, I'm getting the error:
Illegal variable name.
I then tried replacing $(/usr/local/sbin/script.sh 2>&1) with (/usr/local/sbin/script.sh), but instead of output of /usr/local/sbin/script.sh command, It's just assigning the string "/usr/local/sbin" to that parameter.
Please help me.

Docker - run error on window git bash for -v

I run docker in my win10, but use -v params has a error.
docker run --privileged=true -d --name=ubuntu14.04 -v e:/docker/data:/data ubuntu /bin/bash
error:
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: oci runtime error: container_linux.go:262: starting container process caused "exec: \"C:/Program Files/Git/usr/bin/bash\": stat C:/Program Files/Git/usr/bin/bash: no such file or directory".
When I ls this path just like error path pic:
If possible, try the same command in a regular DOS session, instead of a git bash.
That will avoid the git bash session to automatically resolve /bin/bash to C:/Program Files/Git/usr/bin/bash, which won't be known at all by the ubuntu container.
The OP confirms this is working, provided the following options are added:
--attach=STDIN
--privileged=true
winpty docker run -i -t test1 ./bin/sh
Will work on Windows OS.
Add two slashes before bin/sh to turn off GitBash's automatic path conversion.
docker run --privileged=true -d --name=ubuntu14.04 -v e:/docker/data:/data ubuntu //bin/bash
or if you're trying to attach to a running container
docker attach -it ubuntu //bin/bash

Resources