ktomk / pipelines

Pipelines - Run Bitbucket Pipelines Wherever They Dock
https://ktomk.github.io/pipelines/
GNU Affero General Public License v3.0
109 stars 10 forks source link

script non-zero exit status: 243 #22

Open 0xhitesh-91 opened 2 years ago

0xhitesh-91 commented 2 years ago
image: node:16.15.1
pipelines:
    default:
      - step:
          name: test
          caches:
            - node
          script:
            - apt-get update
            - apt-get install postgresql-client -y
            - cd functions
            - npm install
            - sh create-db.sh test
            - sh run_migration.sh test
            - echo "Completed"
          services:
            - postgres
definitions:
  services:
    postgres:
      image: postgres:latest
      variables:
        POSTGRES_USER: 'root'
        POSTGRES_PASSWORD: 'root'

rentsher@rentsher-ThinkPad-P14s-Gen-1:~/work/napses/backend-core$ pwd /home/rentsher/work/napses/backend-core rentsher@rentsher-ThinkPad-P14s-Gen-1:~/work/napses/backend-core$ ls bitbucket-pipelines.yml Dockerfile functions package-lock.json pipe.sh README.md start_api.sh rentsher@rentsher-ThinkPad-P14s-Gen-1:~/work/napses/backend-core$ pipelines +++ step #1

name...........: "test"
effective-image: node:16.15.1
container......: pipelines-1.test.default.backend-core
container-id...: 923bded7d99b

+++ copying files into container...

+++ populating caches...

up to date, audited 922 packages in 1s

89 packages are looking for funding run npm fund for details

found 0 vulnerabilities

script non-zero exit status: 243 rentsher@rentsher-ThinkPad-P14s-Gen-1:~/work/napses/backend-core$

0xhitesh-91 commented 2 years ago
set -x

if [ -z "$1" ]
  then
    echo "Which env do you want to restore for?"
    exit 1
fi
echo 'Creating db...'
NODE_ENV=$1 npx env-cmd -f ./env/.env.$1 npx sequelize-cli db:create --env=$1 
ktomk commented 2 years ago

script non-zero exit status: 243

my shot into the blue as right now I have no time to try it myself: this could be an error by npm via npx of not being able to make the mkdir syscall.

I'd put the shields up and make the call more verbose so it reveals more (if that tooling supports it).

Alternatively you could try if --user is doing any changes.

Also doing an ls -ld . would reveal the ownership/mode of the mounted path in the container. Please add it to the script so that we can see what is going on that level.

You then can do variations on the command-line as well with the --user switch but it might be calling for other problems, just saying. @0xhitesh-91

0xhitesh-91 commented 2 years ago

Thanks for the early reply.

This is what I got while executing with --user, looks like some permission issue. can you point me in the right direction, it will be very helpful. @ktomk

Screenshot from 2022-07-18 15-29-02