CircleCI-Public/slack-orb

Exited with code exit status 77 (permission denied)

britishdan opened this issue · 5 comments

Orb version:

circleci/slack@4.12.1

What happened:

"Slack - Sending Notification" step fails with the following message:

#!/bin/bash -eo pipefail
#!/usr/bin/env sh

# Workaround for Windows Support
# For details, see: https://github.com/CircleCI-Public/slack-orb/pull/380
# shellcheck source=/dev/null
eval printf '%s' "$SLACK_SCRIPT_NOTIFY"

Posting Status
BASH_ENV file: /tmp/.bash_env-6416edcf62c10d5173f87707-3-build
Does Not Exist. Skipping file execution
Checking For JQ + CURL

Exited with code exit status 77
CircleCI received exit code 77

Expected behavior:

Step should succeed

Additional Information:

From "Spin up environment" step:

Build-agent version 1.0.164056-8943dc4a (2023-03-17T15:00:17+0000)
System information:
 Server Version: 20.10.18
 Storage Driver: overlay2
  Backing Filesystem: xfs
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Kernel Version: 5.15.0-1030-aws
 Operating System: Ubuntu 20.04.5 LTS
 OSType: linux
 Architecture: x86_64

Starting container cypress/base:18.14.1

The Docker image provided does not have JQ installed.

image

❯ docker run -it cypress/base:18.14.1 bash
Unable to find image 'cypress/base:18.14.1' locally
18.14.1: Pulling from cypress/base
bb263680fed1: Pull complete
7de8d66220b1: Pull complete
0a0669fff3b0: Pull complete
c58b63236319: Pull complete
45a7d3dc0902: Pull complete
4f4fb700ef54: Pull complete
b9f49082b851: Pull complete
Digest: sha256:4300fc0eb0822c6090403399a3494529ac16d8f18098ba69dac15936fa4c2d1c
Status: Downloaded newer image for cypress/base:18.14.1
root@d5e71521d60c:/# command -v curl
/usr/bin/curl
root@d5e71521d60c:/# command -v jq  
root@d5e71521d60c:/# 

You will either need to build a new image using the image you have provided as the base, adding JQ to it, or you can install JQ as a part of the CI pipeline. We have a JQ orb available here: https://circleci.com/developer/orbs/orb/circleci/jq

jobs:
  build:
    docker:
      - image: your-image
    steps:
      - checkout
      - jq/install

Amazing!
Thank you so much!
When I saw this line Checking For JQ + CURL with no error, I assumed it meant that CURL and JQ are installed.

Hey @KyleTryon , we've added JQ and now we're getting the error in a different way.
Any hints on where to look?

#!/bin/bash -eo pipefail
#!/usr/bin/env sh

# Workaround for Windows Support
# For details, see: https://github.com/CircleCI-Public/slack-orb/pull/380
# shellcheck source=/dev/null
eval printf '%s' "$SLACK_SCRIPT_NOTIFY"

Posting Status
BASH_ENV file: /tmp/.bash_env-64253daa330e643656588e19-4-build
Does Not Exist. Skipping file execution
Checking For JQ + CURL
Sanitizing CIRCLE_JOB...
Sanitizing CIRCLE_PROJECT_REPONAME...
Sanitizing CIRCLE_BRANCH...
Sanitizing CIRCLE_USERNAME...
Sanitizing SLACK_PARAM_MENTIONS...
Sanitizing CIRCLE_BUILD_URL...
Sending to Slack Channel: ***********

Exited with code exit status 77
CircleCI received exit code 77

JQ is installed

root@7df870ccca37:~# jq --version
jq-1.4

Curl is installed

root@7df870ccca37:~# curl --version
curl 7.74.0 (x86_64-pc-linux-gnu) libcurl/7.74.0 OpenSSL/1.1.1n zlib/1.2.11 brotli/1.0.9 libidn2/2.3.0 libpsl/0.21.0 (+libidn2/2.3.0) libssh2/1.9.0 nghttp2/1.43.0 librtmp/2.3
Release-Date: 2020-12-09
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps mqtt pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp 
Features: alt-svc AsynchDNS brotli GSS-API HTTP2 HTTPS-proxy IDN IPv6 Kerberos Largefile libz NTLM NTLM_WB PSL SPNEGO SSL TLS-SRP UnixSockets

This most likely means your root certificates are out of date. Try updating the base image you are running on.

I forgot to update, that yes! you are right.
Thank you for the help!

My final DOCKERFILE:

FROM cypress/base:18.14.1

WORKDIR /bin
RUN wget "http://stedolan.github.io/jq/download/linux64/jq" && chmod 755 jq

WORKDIR /
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates