OCI Functionの実行が全然うまくいきません下記を参考にfunctionを実行させようとしています。https://fnproject.io/tutorials/python/intro/が下記コマンドでのアプリの作成で躓きます。fn create app pythonapp下記のようなエラーが出ます。Fn: user configuration is missing from fileFor more info about config file and how to get required information, see https://docs.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htmがconfigファイルにミスはないはずです。

1件の回答

回答を書く

1003250

2026-01-25 10:10

+ フォロー

OCI Functions (fn)で「user configuration is missing from file」エラーが出る問題ですね。これはFn CLIの設定ファイルが正しく構成されていないことが原因です。解決方法を詳しく説明します。



【エラーの原因】



Fn CLIは~/.fn/config.yamlファイルにユーザー設定を保存しますが、このファイルが存在しないか、必要な情報が欠けているために発生します。



【解決手順】



ステップ 1: OCI CLIの設定確認



Fn CLIはOCI CLIの設定を利用します。まず、OCI CLIが正しく設定されているか確認します。



bash

# OCI CLIのバージョン確認

oci --version



# OCI設定ファイルの存在確認

cat ~/.oci/config





ステップ 2: Fnコンテキストの作成



以下のコマンドでFnコンテキストを作成します:



bash

fn create context \u0026lt;context-name\u0026gt; --provider oracle





例:

bash

fn create context my-context --provider oracle





ステップ 3: コンテキストの使用設定



bash

fn use context \u0026lt;context-name\u0026gt;





例:

bash

fn use context my-context





ステップ 4: 必要な設定値を追加



以下の情報を設定します:



bash

# Oracle Functions API URL

fn update context api-url https://functions.\u0026lt;region\u0026gt;.oci.oraclecloud.com



# OCIコンパートメントID

fn update context oracle.compartment-id \u0026lt;your-compartment-id\u0026gt;



# OCIプロファイル名

fn update context oracle.profile \u0026lt;profile-name\u0026gt;



# Dockerレジストリ設定

fn update context registry \u0026lt;region-key\u0026gt;.ocir.io/\u0026lt;tenancy-namespace\u0026gt;/\u0026lt;repo-name\u0026gt;





具体例:



bash

# 東京リージョンの場合

fn update context api-url https://functions.ap-tokyo-1.oci.oraclecloud.com



# コンパートメントIDの設定

fn update context oracle.compartment-id ocid1.compartment.oc1..aaaaaaaa...



# DEFAULTプロファイル使用

fn update context oracle.profile DEFAULT



# レジストリ設定

fn update context registry nrt.ocir.io/your-tenancy/my-functions





ステップ 5: 設定確認



bash

# 現在の設定を確認

fn list context



# 詳細設定確認

fn get config



# または直接ファイルを確認

cat ~/.fn/config.yaml





【必要な情報の取得方法】



1. コンパートメントID

- OCIコンソールで: Identity \u0026amp; Security → Compartments

- 使用したいコンパートメントをクリック → OCIDをコピー



2. Tenancy Namespace

bash

oci os ns get





3. リージョンキー

- 東京:
nrt

- ソウル:
icn

- 大阪:
kix

- シンガポール:
sin



【config.yamlの例】



正しく設定された
~/.fn/config.yaml は以下のようになります:



yaml

contexts:

my-context:

api-url: https://functions.ap-tokyo-1.oci.oraclecloud.com

oracle.compartment-id: ocid1.compartment.oc1..aaaaaaaa...

oracle.profile: DEFAULT

provider: oracle

registry: nrt.ocir.io/your-tenancy/my-functions

current-context: my-context





【トラブルシューティング】



もし上記で解決しない場合:



1. 環境変数を使う方法



bash

export OCI_CLI_PROFILE=DEFAULT

export OCI_CLI_COMPARTMENT_ID=\u0026lt;your-compartment-id\u0026gt;





2. fnコマンドで直接指定



bash

fn create app pythonapp \\

--compartment-id \u0026lt;your-compartment-id\u0026gt; \\

--config DOCKER_REGISTRY=nrt.ocir.io/your-tenancy/my-functions





3. 設定ファイルの再作成



bash

# 現在の設定を削除

rm -rf ~/.fn



# 再度上記の手順で設定





【参考ドキュメント】



- OCI Functions公式ドキュメント: https://docs.oracle.com/ja-jp/iaas/Content/Functions/home.htm

- Fn Project: https://fnproject.io/



これらの手順で
fn create appコマンドが正常に実行されるはずです!

うったえる有益だ(0シェアするブックマークする

関連質問

Copyright © 2026 AQ188.com All Rights Reserved.

博識 著作権所有