EACCES permission error when trying to upload build to firebase

Hi,

I’m on a project using Unity Cloud Build to build different version, and we are using a post script to upload the newly created versions to Google Firebase.
However, we noticed that starting last week, the builds were not being deployed to firebase anymore.
We can see the following error in the logs when trying to upload the newly created version:

start to upload to firebase
/BUILD_PATH/.nvm/versions/node/v16.19.0/lib/node_modules/firebase-tools/node_modules/configstore/index.js:68
[error] throw error;
^
[error] Error: EACCES: permission denied, mkdir ‘/BUILD_PATH/.config/configstore’
You don’t have access to this file.
at Object.mkdirSync (node:fs:1382:3)
at AsyncFunction.module.exports.sync (/BUILD_PATH/.nvm/versions/node/v16.19.0/lib/node_modules/firebase-tools/node_modules/make-dir/index.js:114:6)
at Configstore.set all [as all] (/BUILD_PATH/.nvm/versions/node/v16.19.0/lib/node_modules/firebase-tools/node_modules/configstore/index.js:59:12)
at Configstore.set (/BUILD_PATH/.nvm/versions/node/v16.19.0/lib/node_modules/firebase-tools/node_modules/configstore/index.js:91:12)
at Object. (/BUILD_PATH/.nvm/versions/node/v16.19.0/lib/node_modules/firebase-tools/lib/track.js:20:31)
at Module._compile (node:internal/modules/cjs/loader:1165:14)
at Object.Module._extensions…js (node:internal/modules/cjs/loader:1219:10)
at Module.load (node:internal/modules/cjs/loader:1043:32)
at Function.Module._load (node:internal/modules/cjs/loader:878:12)
at Module.require (node:internal/modules/cjs/loader:1067:19) {
errno: -13,
syscall: ‘mkdir’,
code: ‘EACCES’,
path: ‘/BUILD_PATH/.config/configstore’
}

If it is of any help, here is the script we use, and which worked fine until now:

    #!/bin/sh
    
    git_branch=$(git branch --show-current)
    # check if cygpath command exists
    echo "checking cygpath existence"
    if [ -x "$(command -v cygpath)" ]; then
        # we have cygpath, we are in a windows environment. convert the path to windows path.
        unity_player_path_final=$(cygpath -w "${UNITY_PLAYER_PATH}")
    else
        # no cygpath, we are in a unix environment. no need to convert the path.
        unity_player_path_final=${UNITY_PLAYER_PATH}
    fi

    # install firebase-tools via npm
    echo "starting firebase installation"
    sudo npm install -g firebase-tools

    #logs in to Google
    echo "logging to google"
    export GOOGLE_APPLICATION_CREDENTIALS=${GOOGLE_APPLICATION_CREDENTIALS}
    
    # upload to firebase app distribution
    echo "start to upload to firebase"
    firebase appdistribution:distribute "${unity_player_path_final}" --app "${FIREBASE_APP}" --groups "${FIREBASE_GROUPS}" --release-notes "${git_branch} ${UCB_BUILD_NUMBER} ${BUILD_REVISION}"

Any idea where that error could be coming from?
Thanks for your help.

If this is failing on Mac, could you try again?

This was indeed failing on Mac.
We’ve been pushing several builds since this morning, and they now seem to be pushed to firebase as expected.

Thanks for your help.