Docker build fails, getting: failed to connect to proxy No route to host - linux

I am trying to set Prelude SIEM on docker container by following this repository:
https://hub.docker.com/r/2xyo/prelude-siem
When I try to build the container with:
docker build -t prelude .
I get a curl error when trying to reach to the proxy server:
sumaia#main-srv:~/core/docker-prelude-siem$ docker build -t prelude .
Sending build context to Docker daemon 157.2kB
Step 1/37 : FROM centos:centos7
---> eeb6ee3f44bd
Step 2/37 : MAINTAINER 2xyo
---> Using cache
---> 067affd319d1
Step 3/37 : ARG PRELUDE_VERSION
---> Using cache
---> 52efc46cd210
Step 4/37 : ENV PRELUDE_VERSION ${PRELUDE_VERSION:-1.2.6}
---> Using cache
---> 34dfd4af7e35
Step 5/37 : RUN mkdir -p /opt/prelude-src
---> Using cache
---> 8ed92176b862
Step 6/37 : WORKDIR /opt/prelude-src
---> Using cache
---> 817dd04576b6
Step 7/37 : RUN curl https://www.prelude-siem.org/attachments/download/408/libpreludedb-${PRELUDE_VERSION}.tar.gz | tar xz && curl https://www.prelude-siem.org/attachments/download/409/prelude-correlator-${PRELUDE_VERSION}.tar.gz | tar xz && curl https://www.prelude-siem.org/attachments/download/410/libprelude-${PRELUDE_VERSION}.tar.gz | tar xz && curl https://www.prelude-siem.org/attachments/download/411/prelude-lml-${PRELUDE_VERSION}.tar.gz | tar xz && curl https://www.prelude-siem.org/attachments/download/412/prelude-lml-rules-${PRELUDE_VERSION}.tar.gz | tar xz && curl https://www.prelude-siem.org/attachments/download/413/prewikka-${PRELUDE_VERSION}.tar.gz | tar xz && curl https://www.prelude-siem.org/attachments/download/414/prelude-manager-${PRELUDE_VERSION}.tar.gz | tar xz
---> Running in 738d226a8f9f
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- 0:00:03 --:--:-- 0curl: (7) Failed connect to <Proxy IP>:80; No route to host
gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
The command '/bin/sh -c curl https://www.prelude-siem.org/attachments/download/408/libpreludedb-${PRELUDE_VERSION}.tar.gz | tar xz && curl https://www.prelude-siem.org/attachments/download/409/prelude-correlator-${PRELUDE_VERSION}.tar.gz | tar xz && curl https://www.prelude-siem.org/attachments/download/410/libprelude-${PRELUDE_VERSION}.tar.gz | tar xz && curl https://www.prelude-siem.org/attachments/download/411/prelude-lml-${PRELUDE_VERSION}.tar.gz | tar xz && curl https://www.prelude-siem.org/attachments/download/412/prelude-lml-rules-${PRELUDE_VERSION}.tar.gz | tar xz && curl https://www.prelude-siem.org/attachments/download/413/prewikka-${PRELUDE_VERSION}.tar.gz | tar xz && curl https://www.prelude-siem.org/attachments/download/414/prelude-manager-${PRELUDE_VERSION}.tar.gz | tar xz' returned a non-zero code: 2
sumaia#main-srv:~/core/docker-prelude-siem$
My network is behind proxy, and it has been working on my machine without issues for some time, and docker is able to pull images without issues, here is my ~/.docker/config.json file content:
{
"auths": {
"https://index.docker.io/v1/": {
"auth": "c29tYXl5YWhtb2hkOnZDZ3Y1ampBTThuZ1NNOA=="
}
},
"HttpHeaders": {
"User-Agent": "Docker-Client/19.03.12 (linux)"
},
"proxies": {
"default": {
"httpProxy": "http://<proxy IP>:80",
"httpsProxy": "http://<proxy IP>:80",
"noProxy": "*.internaldomain.net"
}
}
}
am I missing something?

So the issue was due to an old interface that is not disabled, after disabling it, the issue was fixed.

Related

Trouble fetching linux-altera-ltsi-rt for yocto dunfell

I am attempting to bitbake an image for a de0-nano-soc board with the RT patch and I am getting fetch errors.
This is the settings in my local.conf
# Real time patch needs 4.9 toolchain.
MACHINE ?= "cyclone5"
GCCVERSION = "linaro-4.9"
SDKGCCVERSION = "linaro-4.9"
DEFAULTTUNE = "cortexa9hf-neon"
PREFERRED_PROVIDER_virtual/kernel = "linux-altera-ltsi-rt"
PREFERRED_VERSION_linux-altera-ltsi-rt = "4.14.126%"
UBOOT_CONFIG = "de0-nano-soc"
UBOOT_EXTLINUX_FDT_default = "../socfpga_cyclone5_de0_nano_soc.dtb"
#
# Additional packages/recipes utilized from other layers should be included here.
#
IMAGE_INSTALL_append += "openssh apt dpkg nano nodejs zeromq ninja protobuf"
and my bblayers.conf
BBLAYERS ?= " \
/home/asei/Documents/yocto-kirkstone/poky/meta \
/home/asei/Documents/yocto-kirkstone/poky/meta-poky \
/home/asei/Documents/yocto-kirkstone/poky/meta-yocto-bsp \
/home/asei/Documents/yocto-kirkstone/poky/meta-altera \
/home/asei/Documents/yocto-kirkstone/poky/meta-openembedded/meta-oe \
/home/asei/Documents/yocto-kirkstone/poky/meta-openembedded/meta-python \
/home/asei/Documents/yocto-kirkstone/poky/meta-openembedded/meta-networking \
/home/asei/Documents/yocto-kirkstone/poky/meta-openembedded/meta-webserver \
"
error log states this:
DEBUG: For url ['git', 'github.com', '/altera-opensource/linux-socfpga.git', '', '', OrderedDict([('protocol', 'https'), ('branch', 'socfpga-4.14.126-ltsi-rt')])] comparing ['git', '.*', '/.*', '', '', OrderedDict()] to ['git', 'HOST', '/PATH', '', '', OrderedDict([('protocol', 'https')])]
DEBUG: Fetching http://downloads.yoctoproject.org/mirror/sources/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz using command '/usr/bin/env wget -t 2 -T 30 --passive-ftp --no-check-certificate -O /home/asei/Documents/yocto-de0nano/build/downloads/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz.tmp -P /home/asei/Documents/yocto-de0nano/build/downloads 'http://downloads.yoctoproject.org/mirror/sources/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz''
DEBUG: Fetcher accessed the network with the command /usr/bin/env wget -t 2 -T 30 --passive-ftp --no-check-certificate -O /home/asei/Documents/yocto-de0nano/build/downloads/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz.tmp -P /home/asei/Documents/yocto-de0nano/build/downloads 'http://downloads.yoctoproject.org/mirror/sources/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz'
DEBUG: Running export PSEUDO_DISABLED=1; export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"; export SSH_AGENT_PID="1205"; export SSH_AUTH_SOCK="/run/user/1000/keyring/ssh"; export PATH="/home/asei/Documents/yocto-de0nano/build/tmp/sysroots-uninative/x86_64-linux/usr/bin:/home/asei/Documents/yocto-de0nano/poky/scripts:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot/usr/bin/crossscripts:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/usr/sbin:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/usr/bin:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/sbin:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/bin:/home/asei/Documents/yocto-de0nano/poky/bitbake/bin:/home/asei/Documents/yocto-de0nano/build/tmp/hosttools"; export HOME="/home/asei"; /usr/bin/env wget -t 2 -T 30 --passive-ftp --no-check-certificate -O /home/asei/Documents/yocto-de0nano/build/downloads/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz.tmp -P /home/asei/Documents/yocto-de0nano/build/downloads 'http://downloads.yoctoproject.org/mirror/sources/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz' --progress=dot -v
--2022-11-21 23:17:34-- http://downloads.yoctoproject.org/mirror/sources/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz
Resolving downloads.yoctoproject.org (downloads.yoctoproject.org)... 198.145.29.62
Connecting to downloads.yoctoproject.org (downloads.yoctoproject.org)|198.145.29.62|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2022-11-21 23:17:34 ERROR 404: Not Found.
DEBUG: Mirror fetch failure for url http://downloads.yoctoproject.org/mirror/sources/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz (original url: git://github.com/altera-opensource/linux-socfpga.git;protocol=https;branch=socfpga-4.14.126-ltsi-rt)
DEBUG: Fetcher failure: Fetch command export PSEUDO_DISABLED=1; export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"; export SSH_AGENT_PID="1205"; export SSH_AUTH_SOCK="/run/user/1000/keyring/ssh"; export PATH="/home/asei/Documents/yocto-de0nano/build/tmp/sysroots-uninative/x86_64-linux/usr/bin:/home/asei/Documents/yocto-de0nano/poky/scripts:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot/usr/bin/crossscripts:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/usr/sbin:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/usr/bin:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/sbin:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/bin:/home/asei/Documents/yocto-de0nano/poky/bitbake/bin:/home/asei/Documents/yocto-de0nano/build/tmp/hosttools"; export HOME="/home/asei"; /usr/bin/env wget -t 2 -T 30 --passive-ftp --no-check-certificate -O /home/asei/Documents/yocto-de0nano/build/downloads/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz.tmp -P /home/asei/Documents/yocto-de0nano/build/downloads 'http://downloads.yoctoproject.org/mirror/sources/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz' --progress=dot -v failed with exit code 8, no output
DEBUG: Fetching http://sources.openembedded.org/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz using command '/usr/bin/env wget -t 2 -T 30 --passive-ftp --no-check-certificate -O /home/asei/Documents/yocto-de0nano/build/downloads/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz.tmp -P /home/asei/Documents/yocto-de0nano/build/downloads 'http://sources.openembedded.org/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz''
DEBUG: Fetcher accessed the network with the command /usr/bin/env wget -t 2 -T 30 --passive-ftp --no-check-certificate -O /home/asei/Documents/yocto-de0nano/build/downloads/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz.tmp -P /home/asei/Documents/yocto-de0nano/build/downloads 'http://sources.openembedded.org/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz'
DEBUG: Running export PSEUDO_DISABLED=1; export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"; export SSH_AGENT_PID="1205"; export SSH_AUTH_SOCK="/run/user/1000/keyring/ssh"; export PATH="/home/asei/Documents/yocto-de0nano/build/tmp/sysroots-uninative/x86_64-linux/usr/bin:/home/asei/Documents/yocto-de0nano/poky/scripts:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot/usr/bin/crossscripts:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/usr/sbin:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/usr/bin:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/sbin:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/bin:/home/asei/Documents/yocto-de0nano/poky/bitbake/bin:/home/asei/Documents/yocto-de0nano/build/tmp/hosttools"; export HOME="/home/asei"; /usr/bin/env wget -t 2 -T 30 --passive-ftp --no-check-certificate -O /home/asei/Documents/yocto-de0nano/build/downloads/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz.tmp -P /home/asei/Documents/yocto-de0nano/build/downloads 'http://sources.openembedded.org/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz' --progress=dot -v
--2022-11-21 23:17:34-- http://sources.openembedded.org/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz
Resolving sources.openembedded.org (sources.openembedded.org)... 198.145.29.27
Connecting to sources.openembedded.org (sources.openembedded.org)|198.145.29.27|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2022-11-21 23:17:34 ERROR 404: Not Found.
DEBUG: Mirror fetch failure for url http://sources.openembedded.org/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz (original url: git://github.com/altera-opensource/linux-socfpga.git;protocol=https;branch=socfpga-4.14.126-ltsi-rt)
DEBUG: Fetcher failure: Fetch command export PSEUDO_DISABLED=1; export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"; export SSH_AGENT_PID="1205"; export SSH_AUTH_SOCK="/run/user/1000/keyring/ssh"; export PATH="/home/asei/Documents/yocto-de0nano/build/tmp/sysroots-uninative/x86_64-linux/usr/bin:/home/asei/Documents/yocto-de0nano/poky/scripts:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot/usr/bin/crossscripts:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/usr/sbin:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/usr/bin:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/sbin:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/bin:/home/asei/Documents/yocto-de0nano/poky/bitbake/bin:/home/asei/Documents/yocto-de0nano/build/tmp/hosttools"; export HOME="/home/asei"; /usr/bin/env wget -t 2 -T 30 --passive-ftp --no-check-certificate -O /home/asei/Documents/yocto-de0nano/build/downloads/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz.tmp -P /home/asei/Documents/yocto-de0nano/build/downloads 'http://sources.openembedded.org/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz' --progress=dot -v failed with exit code 8, no output
DEBUG: Fetching https://mirrors.kernel.org/yocto-sources/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz using command '/usr/bin/env wget -t 2 -T 30 --passive-ftp --no-check-certificate -O /home/asei/Documents/yocto-de0nano/build/downloads/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz.tmp -P /home/asei/Documents/yocto-de0nano/build/downloads 'https://mirrors.kernel.org/yocto-sources/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz''
DEBUG: Fetcher accessed the network with the command /usr/bin/env wget -t 2 -T 30 --passive-ftp --no-check-certificate -O /home/asei/Documents/yocto-de0nano/build/downloads/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz.tmp -P /home/asei/Documents/yocto-de0nano/build/downloads 'https://mirrors.kernel.org/yocto-sources/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz'
DEBUG: Running export PSEUDO_DISABLED=1; export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"; export SSH_AGENT_PID="1205"; export SSH_AUTH_SOCK="/run/user/1000/keyring/ssh"; export PATH="/home/asei/Documents/yocto-de0nano/build/tmp/sysroots-uninative/x86_64-linux/usr/bin:/home/asei/Documents/yocto-de0nano/poky/scripts:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot/usr/bin/crossscripts:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/usr/sbin:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/usr/bin:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/sbin:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/bin:/home/asei/Documents/yocto-de0nano/poky/bitbake/bin:/home/asei/Documents/yocto-de0nano/build/tmp/hosttools"; export HOME="/home/asei"; /usr/bin/env wget -t 2 -T 30 --passive-ftp --no-check-certificate -O /home/asei/Documents/yocto-de0nano/build/downloads/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz.tmp -P /home/asei/Documents/yocto-de0nano/build/downloads 'https://mirrors.kernel.org/yocto-sources/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz' --progress=dot -v
--2022-11-21 23:17:34-- https://mirrors.kernel.org/yocto-sources/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz
Resolving mirrors.kernel.org (mirrors.kernel.org)... 139.178.88.99, 2604:1380:45e3:2400::1
Connecting to mirrors.kernel.org (mirrors.kernel.org)|139.178.88.99|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2022-11-21 23:17:34 ERROR 404: Not Found.
DEBUG: Mirror fetch failure for url https://mirrors.kernel.org/yocto-sources/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz (original url: git://github.com/altera-opensource/linux-socfpga.git;protocol=https;branch=socfpga-4.14.126-ltsi-rt)
DEBUG: Fetcher failure: Fetch command export PSEUDO_DISABLED=1; export DBUS_SESSION_BUS_ADDRESS="unix:path=/run/user/1000/bus"; export SSH_AGENT_PID="1205"; export SSH_AUTH_SOCK="/run/user/1000/keyring/ssh"; export PATH="/home/asei/Documents/yocto-de0nano/build/tmp/sysroots-uninative/x86_64-linux/usr/bin:/home/asei/Documents/yocto-de0nano/poky/scripts:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot/usr/bin/crossscripts:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/usr/sbin:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/usr/bin:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/sbin:/home/asei/Documents/yocto-de0nano/build/tmp/work/cyclone5-poky-linux-gnueabi/linux-altera-ltsi-rt/4.14.126-ltsi-rt+gitAUTOINC+652711a08d-r0/recipe-sysroot-native/bin:/home/asei/Documents/yocto-de0nano/poky/bitbake/bin:/home/asei/Documents/yocto-de0nano/build/tmp/hosttools"; export HOME="/home/asei"; /usr/bin/env wget -t 2 -T 30 --passive-ftp --no-check-certificate -O /home/asei/Documents/yocto-de0nano/build/downloads/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz.tmp -P /home/asei/Documents/yocto-de0nano/build/downloads 'https://mirrors.kernel.org/yocto-sources/git2_github.com.altera-opensource.linux-socfpga.git.tar.gz' --progress=dot -v failed with exit code 8, no output
ERROR: Fetcher failure: Unable to find revision 652711a08dbe255d0aa3c2dd7231d6c6bfc61817 in branch socfpga-4.14.126-ltsi-rt even from upstream
ERROR: Bitbake Fetcher Error: FetchError('Unable to fetch URL from any source.', 'git://github.com/altera-opensource/linux-socfpga.git;protocol=https;branch=socfpga-4.14.126-ltsi-rt')
DEBUG: Python function base_do_fetch finished
DEBUG: Python function do_fetch finished
I looked for the linux-socfpga github and there doesnt seem to be a branch for any rt patch?

Ansible dnf module returns success even when dnf fails

This is the initial state of my system:
I have myrpm-2.0 installed.
This rpm creates just a file.
/usr/share/myfile exists as a file.
/root# rpm -q myrpm
myrpm-2.0-0.x86_64
/root# rpm -ql myrpm-2.0-0.x86_64
/usr/share
/usr/share/myfile
/root# ls -lrt /usr/share | grep myfile
-rw-r--r-- 1 root root 11 May 25 17:32 myfile
/root#
Now I am simulating an error condition. I manually removed the file and created a directory in it's place.
/root# ls -lrt /usr/share | grep myfile
drwxr-xr-x 2 root root 4096 May 25 18:33 myfile
/root#
I prepared a higher version 3.0 of the same rpm, which copies the same file.
/root# rpm -ql /root/update/myrpm-3.0-0.x86_64.rpm
/usr/share
/usr/share/myfile
/root#
4-Test-1: Trying rpm upgrade using ansible's builtin dnf module.
Following is my playbook:
/root# cat test.yaml
---
- hosts: localhost
tasks:
- name: update rpm
dnf:
name: "myrpm"
state: latest
/root#
Executing this playbook gives return code as 0.
/root# ansible-playbook -vvv test.yaml
...
changed: [localhost] => {
"changed": true,
"invocation": {
"module_args": {
"allow_downgrade": false,
"autoremove": false,
"bugfix": false,
"conf_file": null,
"disable_excludes": null,
"disable_gpg_check": false,
"disable_plugin": [],
"disablerepo": [],
"download_dir": null,
"download_only": false,
"enable_plugin": [],
"enablerepo": [],
"exclude": [],
"install_repoquery": true,
"install_weak_deps": true,
"installroot": "/",
"list": null,
"lock_timeout": 30,
"name": [
"myrpm"
],
"releasever": null,
"security": false,
"skip_broken": false,
"state": "latest",
"update_cache": false,
"update_only": false,
"validate_certs": true
}
},
"msg": "",
"rc": 0,
"results": [
"Installed: myrpm-3.0-0.x86_64",
"Removed: myrpm-2.0-0.x86_64"
]
}
META: ran handlers
META: ran handlers
PLAY RECAP *******************************************************************************************
localhost : ok=2 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
/root# echo $?
0
/root#
rc is 0 as per the verbose log.
However, I can see that dnf command has failed.
/root# dnf history | head -n 3
ID | Command line | Date and time | Action(s) | Altered
-------------------------------------------------------------------------------
27 | | 2022-05-25 18:39 | Upgrade | 1 EE
/root# dnf history info 27 | tail -6
Packages Altered:
** Upgrade myrpm-3.0-0.x86_64 #My_Update
Upgraded myrpm-2.0-0.x86_64 ##System
Scriptlet output:
1 error: unpacking of archive failed on file /usr/share/myfile: cpio: File from package already exists as a directory in system
2 error: myrpm-3.0-0.x86_64: install failed
/root#
4-Test-2: I made my system in exact same state as 3, and used direct dnf command instead of playbook.
/root# dnf update myrpm
...
Preparing : 1/1
Upgrading : myrpm-3.0-0.x86_64 1/2
Error unpacking rpm package myrpm-3.0-0.x86_64
error: unpacking of archive failed on file /usr/share/myfile: cpio: File from package already exists as a directory in system
Cleanup : myrpm-2.0-0.x86_64 2/2
error: myrpm-3.0-0.x86_64: install failed
Verifying : myrpm-3.0-0.x86_64 1/2
Verifying : myrpm-2.0-0.x86_64 2/2
Failed:
myrpm-3.0-0.x86_64
Error: Transaction failed
/root# echo $?
1
/root#
Any clue on why the playbook did not show task as failed?
Got to know that this is a bug fixed in higher versions of ansible.
Refer https://github.com/ansible/ansible/issues/77917

AWS lambda function throwing error "constchildProcess is not defined"

I am using AWS lambda function with below code
'use strict';
constchildProcess= require("child_process");
constpath= require("path");
const backupDatabase = () => {
const scriptFilePath =path.resolve(__dirname, "./backup.sh");
return newPromise((resolve, reject) => {
childProcess.execFile(scriptFilePath, (error) => {
if (error) {
console.error(error);
resolve(false);
}
resolve(true);
});
});
};
module.exports.handler = async (event) => {
const isBackupSuccessful = await backupDatabase();
if (isBackupSuccessful) {
return {
status: "success",
message: "Database backup completed successfully!"
};
}
return {
status: "failed",
message: "Failed to backup the database! Check out the logs for more details"
};
};
The code above run's with in the docker container, tries to run the below backup script
#!/bin/bash
#
# Author: Bruno Coimbra <bbcoimbra#gmail.com>
#
# Backups database located in DB_HOST, DB_PORT, DB_NAME
# and can be accessed using DB_USER. Password should be
# located in $HOME/.pgpass and this file should be
# chmod 0600[1].
#
# Target bucket should be set in BACKUP_BUCKET variable.
#
# AWS credentials should be available as needed by aws-cli[2].
#
# Dependencies:
#
# * pg_dump executable (can be found in postgresql-client-<version> package)
# * aws-cli (with python environment configured execute 'pip install awscli')
#
#
# References
# [1] - http://www.postgresql.org/docs/9.3/static/libpq-pgpass.html
# [2] - http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html
#
#
###############
### Variables
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
DB_HOST=
DB_PORT="5432"
DB_USER="postgres"
BACKUP_BUCKET=
###############
#
# **RISK ZONE** DON'T TOUCH below this line unless you know
# exactly what you are doing.
#
###############
set -e
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
### Variables
S3_BACKUP_BUCKET=${BACKUP_BUCKET:-test-db-backup-bucket}
TEMPFILE_PREFIX="db-$DB_NAME-backup"
TEMPFILE="$(mktemp -t $TEMPFILE_PREFIX-XXXXXXXX)"
DATE="$(date +%Y-%m-%d)"
TIMESTAMP="$(date +%s)"
BACKUPFILE="backup-$DB_NAME-$TIMESTAMP.sql.gz"
LOGTAG="DB $DB_NAME Backup"
### Validations
if [[ ! -r "$HOME/.pgpass" ]]; then
logger -t "$LOGTAG" "$0: Can't find database credentials. $HOME/.pgpass file isn't readable. Aborted."
exit 1
fi
if ! which pg_dump > /dev/null; then
logger -t "$LOGTAG" "$0: Can't find 'pg_dump' executable. Aborted."
exit 1
fi
if ! which aws > /dev/null; then
logger -t "$LOGTAG" "$0: Can't find 'aws cli' executable. Aborted."
exit 1
fi
logger -t "$LOGTAG" "$0: remove any previous dirty backup file"
rm -f /tmp/$TEMPFILE_PREFIX*
### Generate dump and compress it
logger -t "$LOGTAG" "Dumping Database..."
pg_dump -O -x -h "$DB_HOST" -p "$DB_PORT" -U "$DB_USER" -w "$DB_NAME" > "$TEMPFILE"
logger -t "$LOGTAG" "Dumped."
logger -t "$LOGTAG" "Compressing file..."
nice gzip -9 "$TEMPFILE"
logger -t "$LOGTAG" "Compressed."
mv "$TEMPFILE.gz" "$BACKUPFILE"
### Upload it to S3 Bucket and cleanup
logger -t "$LOGTAG" "Uploading '$BACKUPFILE' to S3..."
aws s3 cp "$BACKUPFILE" "s3://$S3_BACKUP_BUCKET/$DATE/$BACKUPFILE"
logger -t "$LOGTAG" "Uploaded."
logger -t "$LOGTAG" "Clean-up..."
rm -f $TEMPFILE
rm -f $BACKUPFILE
rm -f /tmp/$TEMPFILE_PREFIX*
logger -t "$LOGTAG" "Finished."
if [ $? -eq 0 ]; then
echo "script passed"
exit 0
else
echo "script failed"
exit 1
fi
I created a docker image with above app.js content and bakup.sh with the below docker file
ARG FUNCTION_DIR="/function"
FROM node:14-buster
RUN apt-get update && \
apt install -y \
g++ \
make \
cmake \
autoconf \
libtool \
wget \
openssh-client \
gnupg2
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list && \
apt-get update && apt-get -y install postgresql-client-12
ARG FUNCTION_DIR
RUN mkdir -p ${FUNCTION_DIR} && chmod -R 755 ${FUNCTION_DIR}
WORKDIR ${FUNCTION_DIR}
COPY package.json .
RUN npm install
COPY backup.sh .
RUN chmod +x backup.sh
COPY app.js .
ENTRYPOINT ["/usr/local/bin/npx", "aws-lambda-ric"]
CMD ["app.handler"]
I am running the docker container created with the image created from the above docker file
docker run -v ~/aws:/aws -it --rm -p 9000:8080 --entrypoint /aws/aws-lambda-rie backup-db:v1 /usr/local/bin/npx aws-lambda-ric app.handler
And trying to hit that docker container with below curl command
curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'
when I run curl command I am seeing the below error
29 Nov 2021 10:57:30,838 [INFO] (rapid) extensionsDisabledByLayer(/opt/disable-extensions-jwigqn8j) -> stat /opt/disable-extensions-jwigqn8j: no such file or directory
29 Nov 2021 10:57:30,838 [WARNING] (rapid) Cannot list external agents error=open /opt/extensions: no such file or directory
START RequestId: 053246ef-4687-438d-aade-a6794b917b79 Version: $LATEST
2021-11-29T10:57:30.912Z undefined INFO Executing 'app.handler' in function directory '/function'
2021-11-29T10:57:30.919Z undefined ERROR constchildProcess is not defined
29 Nov 2021 10:57:30,926 [WARNING] (rapid) First fatal error stored in appctx: Runtime.ExitError
29 Nov 2021 10:57:30,927 [WARNING] (rapid) Process 53(npx) exited: Runtime exited with error: exit status 1
29 Nov 2021 10:57:30,927 [ERROR] (rapid) Init failed error=Runtime exited with error: exit status 1 InvokeID=
29 Nov 2021 10:57:30,927 [WARNING] (rapid) Reset initiated: ReserveFail
29 Nov 2021 10:57:30,927 [WARNING] (rapid) Cannot list external agents error=open /opt/extensions: no such file or directory
Could someone help me with fixing the error ? My expected output is the message as described in the function, but am seeing the errors.
Thank you
Because they both do not exist. There is a typo on your first 2 lines:
constchildProcess= require("child_process");
constpath= require("path");
Should be:
const childProcess= require("child_process");
const path= require("path");

AWS lambda function throwing error "newPromise is not defined"

I am using AWS lambda function with below code
'use strict';
var newPromise = require('es6-promise').Promise;
const childProcess= require("child_process");
const path= require("path");
const backupDatabase = () => {
const scriptFilePath =path.resolve(__dirname, "./backup.sh");
return newPromise((resolve, reject) => {
childProcess.execFile(scriptFilePath, (error) => {
if (error) {
console.error(error);
resolve(false);
}
resolve(true);
});
});
};
module.exports.handler = async (event) => {
const isBackupSuccessful = await backupDatabase();
if (isBackupSuccessful) {
return {
status: "success",
message: "Database backup completed successfully!"
};
}
return {
status: "failed",
message: "Failed to backup the database! Check out the logs for more details"
};
};
The code above run's with in the docker container, tries to run the below backup script
#!/bin/bash
#
# Author: Bruno Coimbra <bbcoimbra#gmail.com>
#
# Backups database located in DB_HOST, DB_PORT, DB_NAME
# and can be accessed using DB_USER. Password should be
# located in $HOME/.pgpass and this file should be
# chmod 0600[1].
#
# Target bucket should be set in BACKUP_BUCKET variable.
#
# AWS credentials should be available as needed by aws-cli[2].
#
# Dependencies:
#
# * pg_dump executable (can be found in postgresql-client-<version> package)
# * aws-cli (with python environment configured execute 'pip install awscli')
#
#
# References
# [1] - http://www.postgresql.org/docs/9.3/static/libpq-pgpass.html
# [2] - http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html
#
#
###############
### Variables
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
DB_HOST=
DB_PORT="5432"
DB_USER="postgres"
BACKUP_BUCKET=
###############
#
# **RISK ZONE** DON'T TOUCH below this line unless you know
# exactly what you are doing.
#
###############
set -e
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
### Variables
S3_BACKUP_BUCKET=${BACKUP_BUCKET:-test-db-backup-bucket}
TEMPFILE_PREFIX="db-$DB_NAME-backup"
TEMPFILE="$(mktemp -t $TEMPFILE_PREFIX-XXXXXXXX)"
DATE="$(date +%Y-%m-%d)"
TIMESTAMP="$(date +%s)"
BACKUPFILE="backup-$DB_NAME-$TIMESTAMP.sql.gz"
LOGTAG="DB $DB_NAME Backup"
### Validations
if [[ ! -r "$HOME/.pgpass" ]]; then
logger -t "$LOGTAG" "$0: Can't find database credentials. $HOME/.pgpass file isn't readable. Aborted."
exit 1
fi
if ! which pg_dump > /dev/null; then
logger -t "$LOGTAG" "$0: Can't find 'pg_dump' executable. Aborted."
exit 1
fi
if ! which aws > /dev/null; then
logger -t "$LOGTAG" "$0: Can't find 'aws cli' executable. Aborted."
exit 1
fi
logger -t "$LOGTAG" "$0: remove any previous dirty backup file"
rm -f /tmp/$TEMPFILE_PREFIX*
### Generate dump and compress it
logger -t "$LOGTAG" "Dumping Database..."
pg_dump -O -x -h "$DB_HOST" -p "$DB_PORT" -U "$DB_USER" -w "$DB_NAME" > "$TEMPFILE"
logger -t "$LOGTAG" "Dumped."
logger -t "$LOGTAG" "Compressing file..."
nice gzip -9 "$TEMPFILE"
logger -t "$LOGTAG" "Compressed."
mv "$TEMPFILE.gz" "$BACKUPFILE"
### Upload it to S3 Bucket and cleanup
logger -t "$LOGTAG" "Uploading '$BACKUPFILE' to S3..."
aws s3 cp "$BACKUPFILE" "s3://$S3_BACKUP_BUCKET/$DATE/$BACKUPFILE"
logger -t "$LOGTAG" "Uploaded."
logger -t "$LOGTAG" "Clean-up..."
rm -f $TEMPFILE
rm -f $BACKUPFILE
rm -f /tmp/$TEMPFILE_PREFIX*
logger -t "$LOGTAG" "Finished."
if [ $? -eq 0 ]; then
echo "script passed"
exit 0
else
echo "script failed"
exit 1
fi
I created a docker image with above app.js content and bakup.sh with the below docker file
ARG FUNCTION_DIR="/function"
FROM node:14-buster
RUN apt-get update && \
apt install -y \
g++ \
make \
cmake \
autoconf \
libtool \
wget \
openssh-client \
gnupg2
RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \
echo "deb http://apt.postgresql.org/pub/repos/apt/ buster-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list && \
apt-get update && apt-get -y install postgresql-client-12
ARG FUNCTION_DIR
RUN mkdir -p ${FUNCTION_DIR} && chmod -R 755 ${FUNCTION_DIR}
WORKDIR ${FUNCTION_DIR}
COPY package.json .
RUN npm install
COPY backup.sh .
RUN chmod +x backup.sh
COPY app.js .
ENTRYPOINT ["/usr/local/bin/npx", "aws-lambda-ric"]
CMD ["app.handler"]
I am running the docker container created with the image created from the above docker file
docker run -v ~/aws:/aws -it --rm -p 9000:8080 --entrypoint /aws/aws-lambda-rie backup-db:v1 /usr/local/bin/npx aws-lambda-ric app.handler
And trying to hit that docker container with below curl command
curl -XPOST "http://localhost:9000/2015-03-31/functions/function/invocations" -d '{}'
when I run curl command I am seeing the below error
An error I see is :"newPromise is not defined","trace":["ReferenceError: newPromise is not defined"," at backupDatabase (/function/app.js:9:3)","
Tried adding the variable var newPromise = require('es6-promise').Promise;, but that gave a new error "Cannot set property 'scqfkjngu7o' of undefined","trace"
Could someone help me with fixing the error ? My expected output is the message as described in the function, but am seeing the errors.
Thank you
Node 14 supports promises natively. You should do:
return new Promise((resolve, reject) => {
childProcess.execFile(scriptFilePath, (error) => {
if (error) {
console.error(error);
resolve(false);
}
resolve(true);
});
Note the space between new and Promise. Promise is the object and you are using a constructor. There is no need to import any module.

GitLab CI How to POST JSON data to a url within a CI job using here-document?

Hoping someone can help. I am experiencing difficulty making a curl POST request with JSON data from a gitlab CI job.
The curl request works fine in a local terminal session, (N.B I did not use double quotes in terminal session). If I do not escape double quotes in the gitlab CI yaml I get the error curl: (3) [globbing] nested brace in column 112
If I escape the double quotes in the GitLab CI job, as shown below I get the error:
curl: (3) [globbing] unmatched brace in column 1
In all cases I get the error /bin/bash: line 134: warning: here-document at line 134 delimited by end-of-file (wanted `EOF')
Is it possible to POST JSON data using here-documents from a GitLab CI job?
.gitlab-ci.yml job extract
release:
image: node:12-stretch-slim
stage: release
before_script:
- apt-get update && apt-get install -y curl git jq
script:
- version=$(git describe --tags | cut -d'-' -f 1 | sed 's/^v*//')
- echo "generating release for version ${version}"
- npm pack
# - >
# url=$(curl
# --header "Private-Token: $API_TOKEN"
# -F "file=#${CI_PROJECT_DIR}/objectdetection-plugin-${version}.tgz" "https://gitlab.com/api/v4/projects/${CI_PROJECT_ID}/uploads"
# |
# jq '.url')
- url="http://www.example.com"
- echo "Retrieved url from file upload as ${url}"
- echo "The full url would be ${CI_PROJECT_URL}/${url}"
- >
curl -X POST https://requestbin.io/1f84by61
--header 'Content-Type: application/json; charset=utf-8'
--data-binary #- << EOF
{
\"name\": \"Release v${version}\",
\"tag_name\": \"v${version}\",
\"ref\": \"v${version}\",
\"description\": \"Test\",
\"assets\": {
\"links\": [
{
\"name\": \"objectdetection-plugin-source\",
\"url\": \"CI_PROJECT_URL/${url}\",
\"filepath\": \"${url}\",
\"link_type\": \"other\"
}
]
}
}
EOF
when: manual
only:
- /^release-.*$/
Solved it after reading this
Using |- preserves newlines within the command and does not append a newline at the end of the command string. Used this principle to save the JSON data to a variable and then referenced the variable in the subsequent curl command.
Below I have included the script:
release:
image: node:12-stretch-slim
stage: release
before_script:
- apt-get update && apt-get install -y curl git jq
script:
- git fetch --prune --unshallow
- version=$(git describe --tags | cut -d'-' -f 1 | sed 's/^v*//')
- npm pack
- >
url=$(curl --silent --show-error
--request POST
--header "Private-Token: $API_TOKEN"
-F "file=#${CI_PROJECT_DIR}/objectdetection-plugin-${version}.tgz" "https://gitlab.com/api/v4/projects/${CI_PROJECT_ID}/uploads"
|
jq --raw-output --monochrome-output '.url')
- |-
PAYLOAD=$(cat << JSON
{
"name": "Release v$version",
"tag_name": "v$version",
"ref": "v$version",
"description": "$(sed -zE 's/\r\n|\n/\\n/g' < CHANGELOG.md)",
"assets": {
"links": [
{
"name": "objectdetection-plugin-source",
"url": "$CI_PROJECT_URL$url",
"filepath": "$url",
"link_type": "other"
}
]
}
}
JSON
)
- echo "$PAYLOAD"
- >
http_response=$(curl --silent --show-error --write-out "%{http_code}" -o response.txt
--request POST "https://gitlab.com/api/v4/projects/$CI_PROJECT_ID/releases"
--header 'Content-Type: application/json'
--header 'Accept: application/json'
--header "Private-Token: ${API_TOKEN}"
--data-binary "${PAYLOAD}")
- |-
if [ $http_response != "201" ]; then
exit 1
else
echo "Server returned:"
cat response.txt
fi
when: manual
allow_failure: false
only:
- /^release-.*$/
I was trying to send a message to my Google Chat, WebHook URL, and the above solution didn't work.
So I used this instead
'curl --silent --show-error --location --request POST ${GCHAT_DEVOPS_WEBHOOK} --header ''Content-Type: application/json; charset=UTF-8'' --data-raw ''{"text":"Hey <users/all>: A new build has been deployed to *''${APP_ENVIRONMENT}''* via ''${CI_JOB_NAME}'' - *''${APP_BRANCH}''*"}'''

Resources