(400) Bad Request: The structure of request was invalid op document get

Options
daliad
daliad
Community Member

Hello,

I'm trying to get a document saved in our 1password account on our CI in Xcode Cloud.

I got the service token which works perfectly locally but whenever it tries to execute
op document get Config.zip --out-file=Config.zip fails with this error (400) Bad Request: The structure of request was invalid.

This is how the token is set before trying to download the doc export OP_SERVICE_ACCOUNT_TOKEN=1PASSWORD_TOKEN

Any idea why that might happen?

Thank you,
Dalia


Full script here

!/bin/sh

Install homebrew

set -e

export CI_SCRIPTS_DIR=${PWD}
export RN_DIR=${PWD}/../../
export RN_IOS_DIR=${PWD}/../
export BREW_DIR=${CI_DERIVED_DATA_PATH}/opt/hombrew

echo "*** Date: $(date)"
echo "*** Running post clone script in: ${PWD}. RootDir = ${ROOT_DIR}"
echo "*** Running RN_DIR ${RN_DIR}"
echo "*** Running RN_IOS_DIR ${RN_IOS_DIR}"
echo "*** Running BREW_DIR ${BREW_DIR}"

mkdir -p ${BREW_DIR}

export PATH=${BREW_DIR}/bin:${PATH}

cd ${BREW_DIR}
if [[ ! -e "${BREW_DIR}/bin/homebrew" ]]
then
echo "*** Installing home brew"
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1
else
echo "*** Brew already installed. using $(command -v brew)"
fi

echo "*** PATH: ${PATH}"
cd ${ROOT_DIR}

which brew

Install 1password cli

brew install 1password-cli
ls /Users/local/Homebrew/bin

Print installed version

echo "Installed 1password-cli version $(command op --version)"

Authenticate to 1password

export OP_SERVICE_ACCOUNT_TOKEN=$ONE_PASSWORD_TOKEN

Download document

op document get Config.zip --out-file=Config.zip


1Password Version: Not Provided
Extension Version: 2.21.0
OS Version: macOS Sonoma 14RC
Browser: Not Provided

Comments

  • kdo
    kdo
    Community Member
    Options

    @daliad

    I am currently facing the same issue. Did you find any resolution ?