tutorials
tutorials copied to clipboard
Fn: provider in position: 1 is nil. ComposingConfigurationProvider does not support nil values
fn create context zonea --provider oracle fn use context zonea fn update context oracle.compartment-id $COMPID fn update context api-url $API_URL fn update context registry $ARTIFACTORY
fn create app image-import --annotation oracle.com/oci/subnetIds='["$SUBNET"]'
returns error : Fn: provider in position: 1 is nil. ComposingConfigurationProvider does not support nil values
fn list contexts
CURRENT NAME PROVIDER API URL REGISTRY default default http://localhost:8080
- zonea oracle https://functions.us-gov-xxxxx artifact.xxxx.xxxx
I also get the same error
Was experiencing this same error when trying to run the fn deploy command inside a GitHub action.
Even if using the Run an Oracle Cloud Infrastructure (OCI) CLI" command action before, to confirm I was authenticated, the same error occurred.
Turns out the Fn CLI tool does not support authentication via the environment variables that the OCI CLI can use (OCI_CLI_USER, OCI_CLI_TENANCY, OCI_CLI_FINGERPRINT, OCI_CLI_KEY_CONTENT, OCI_CLI_REGION). It always tries to look for the OCI configuration files inside the $HOME/.oci/ folder. This is very unfortunate, as those files would never get created in an environment where oci config can't be run, as it is an interactive script.
The only solution I found for now was creating all these files manually inside the action, running the Fn CLI commands, and then deleting all the files. This needs to be done in the same step, or else sensitive info (such as your OCI private key) will be exposed in the Docker layers.
Here's an example:
- name: Run Fn CLI commands
run: |-
mkdir "${HOME}/.oci" &&
echo "${{ secrets.OCI_API_KEY }}" > ${HOME}/.oci/oci_api_key.pem &&
echo "[DEFAULT]
user=${{ secrets.OCI_USER }}
fingerprint=${{ secrets.OCI_API_KEY_FINGERPRINT }}
key_file=${HOME}/.oci/oci_api_key.pem
tenancy=${{ secrets.OCI_TENANCY_ID }}
region=${{ vars.OCI_REGION }}" > "${HOME}/.oci/config" &&
fn -v deploy --app my-app &&
rm -rf "${HOME}/.oci/"
Only by doing this the Fn commands started working correctly.