> For the complete documentation index, see [llms.txt](https://help.autify.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.autify.com/nocode-web/when-the-test-doesnt-work/common-errors/autify-connect-common-errors.md). Agents can also search and read this documentation through its [MCP server](https://help.autify.com/~gitbook/mcp).

# Autify Connect のヒントとよくあるエラー

### Autify Connectを使用して、ローカルホストで実行されている Webサイトのテストができない <a href="#i-am-not-able-to-use-autify-connect-to-test-websites" id="i-am-not-able-to-use-autify-connect-to-test-websites"></a>

シナリオのターゲット URL が`http://localhost` `http://127.0.0.1`など、ローカル ホストまたはローカル ネットワークに直接リンクしている場合、localhost テストは正しく機能しません。

代わりに、次のいずれかの方法を使用してテストを実行してください。

1. `localhost.autify.com`を使用します 。 この FQDN `localhost` は、または `127.0.0.1`の代わりに使用できます。 ホスト名 `localhost`を持つテスト シナリオを既にレコーディングしている場合は、テストプランで URL 置換機能を使用できます。
2. 別の ローカルIP アドレス `192.168.86.92`を使用します。
3. `hosts` ファイルを編集し、アプリケーションに対するエイリアスを次のように設定します。

   ```
   127.0.0.1       local.your-application.com
   ::1             local.your-application.com
   ```

   `hosts` ファイルは通常、次のパスにあります。

| OS           | パス                                    |
| ------------ | ------------------------------------- |
| Linux, macOS | /etc/hosts                            |
| Windows      | c:\Windows\System32\Drivers\etc\hosts |

次のホスト名はサポートされていないことに注意してください(これは完全なリストではありません)。

```
localhost
*.localhost
[::1]
127.0.0.1/8
169.254/16
[FE80::]/10
```

これらのホスト名を使用してシナリオを記録する場合は、上記の方法のいずれかを実装する必要があります。

{% hint style="warning" %}
たとえば、Windows OSを使用したテストでも、 `loopback`は認識されます
{% endhint %}

### HTTPSスキームを使用するWebサイトに対してテストを実行すると、「ERR\_SSL\_PROTOCOL\_ERROR」エラーが発生します。

テスト対象のアプリケーションのポートに443(<https://local.autify.com:443> など)を使用するか、httpsの代わりにhttpを使用してください。

### テストが「サイトにアクセスできません。ERR\_TUNNEL\_CONNECTION\_FAILED」というエラーで失敗したのはなぜですか。

このエラーは、以下に示すいくつかの理由で発生する可能性があります。

* 環境内のネットワークパフォーマンスの低下(これがこのエラーの最も頻繁な原因です)
* テスト実行中にAutify Connect Clientがシャットダウンされる
* 高トラフィック下でのアプリケーションパフォーマンスの低下(たとえば、\~10並列のローカルホストアプリケーションに対して多数のテストシナリオを実行する場合)
* Autify Connectサーバーに問題がある場合、テスト接続を処理できません。

### JSON形式でログを書き込む方法

問題調査の際、カスタマーサポートチームがAutify Connect ClientログをJSON形式でリクエストすることがあります。

これを行うには、 --log-format=jsonオプションを指定して autifyconnectを実行します。

```
$ autifyconnect --log-format=json

{
  "level": "info",
  "ts": "2022-09-07T19:56:07.862+0900",
  "msg": "Starting to establish a secure connection with the Autify connect server. Your session ID is \"{sessionID}\"."
}
```

{% hint style="info" %}
ログ レベル情報

ログレベルの詳細については、以下の [ログレベル](#log-level) セクションを参照してください。
{% endhint %}

### Autify Connect Clientログの保存方法

**Linux / macOS / Windows Powershell users**\
ビルトイン `tee` コマンドを使用すると、以下のようにAutify Connectのログをファイルに書き込むことができます。

```
autifyconnect -V --log-format=json  | tee your-log-filename.log
```

### ログ レベル <a href="#log-level" id="log-level"></a>

levelフィールドは ログ レベルを表します。ログレベルは 4 つあります。

| ログ レベル  | 詳細                                                                                                                                                    |
| ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| error   | アプリケーション エラー。Autify Connect Clientに問題があります。                                                                                                           |
| warning | 障害の手がかりを知るために注目すべきものがある場合の警告ログ。例えば、Autify Connect Clientからアクセス先にアクセスできない場合、クライアントは警告レベルのメッセージをログに記録します。                                               |
| info    | Autify Connectサーバーとの接続確立など、通常のイベントに使用します。                                                                                                             |
| debug   | このオプションを指定して `—-verbose` Autify Connect Clientを起動した場合にのみ書き込まれるデバッグ情報です。これには、Autify Connect ClientとAutify Connectサーバー間のセキュア接続を介して転送されたすべてのメッセージが含まれます。 |

### Autify Connect Clientの接続状態を継続的に確認する方法 <a href="#how-to-continously-check-the-status-of-the-autify-connect" id="how-to-continously-check-the-status-of-the-autify-connect"></a>

`autifyconnect`が Autify Connectサーバーに接続され、テスト実行に使用できる状態であることを継続的に確認するには、v0.5.8で追加された `--debug-server-port` オプションを使用します(詳細は [Autify Connect Clientのリリースノート](https://help.autify.com/nocode-web/autify-university/advanced/tests-on-private-environments/autify-connect-release-notes.md)(autifyconnectコマンド) を参照)。

このオプションを使用すると、デバッグおよび監視用のサーバーが、指定したポートのローカルマシンで起動します。

たとえば、次のコマンドは、デバッグ サーバー エンドポイントを提供するアプリケーションをポート 9191 で実行します。

```bash
$ autifyconnect --debug-server-port 9191
```

デバッグサーバーが稼働すると、エンドポイントから `/status` Autify Connect Clientの状態を確認することができます。Autify Connect Clientの準備が整うと、そのエンドポイントを確認した後のレスポンスは次のようになります。

```bash
$ curl http://localhost:9191/status

{
  "status": "ready",
  "message": "(description)..."
}
```

その他のステータスとその意味の詳細については、以下の表を参照してください。

| ステータス        | の説明                                                                 |
| ------------ | ------------------------------------------------------------------- |
| Ready        | Autify Connect ClientがAutify Connectサーバーに接続され、テスト実行に使用できる状態になっています。 |
| Starting     | Autify Connect Clientは起動中ですが、まだAutify Connectサーバーに接続していません。         |
| Reconnecting | Autify Connect ClientがAutify Connectサーバーから切断され、再接続を試みています。          |

## テストが以前は成功していたのに、Autify Connectを使用したテストが失敗する場合

以前は正常に動作していたテストが失敗し始めた場合、以下の方法をお試しください。

### 1. テスト対象のアプリケーションにローカルでアクセス/期待の操作ができるかを確認

Autify Connectが稼働しているマシン上でブラウザを起動し、以下を確認してください：

1. テストシナリオに指定されている **全く同じURL** で、テスト対象のアプリケーションにアクセスできるか
2. 失敗しているテストシナリオの手順を、手動で問題なく実行できるか

### 2. Autify Connect Clientの再起動

Autify Connect Clientを再起動して、問題が解決するかお試しください。

## 上記の方法で問題が解決しない場合、以下の情報を合わせて、Autifyのサポートにご連絡ください

### 1. Autify Connect Clientのバージョン

以下のコマンドを実行して、使用中のバージョンを確認してください：

```
./autifyconnect --version
```

### 2. Autify Connect Clientのログ

詳細な起動ログは、Autify Connect Clientを `-V` オプション付きで起動することで作成できます。「JSON形式でログを書き込む方法」「Autify Connectのクライアントログの保存方法」のセクションをご参考に、取得をお願いします。

{% hint style="info" %}
**注意事項:**

* ログを共有する際は、全ての出力を含めてください。プロキシサーバーの詳細など、機密情報が含まれる場合は必要に応じてマスクしてください。
* 上記のコマンドでAutify Connect Clientを起動すると、すべてのレベルのログがJSON形式で出力されます。本ドキュメントは、その際の参考情報としてもご利用いただけます。
  {% endhint %}

### 3. Autify Connect Clientがインストールされているデバイスの情報

Autify Connect Clientがインストールされているデバイスの **OSバージョン情報** を提供してください。

### 4. プロキシサーバーの詳細（該当する場合）

プロキシサーバーを使用している場合は、以下の情報を提供してください：

{% hint style="info" %}
注意事項:

プロキシサーバーを使用していない場合は、「利用なし」とお答えください。
{% endhint %}

#### 4-1. 目的

用途について、Proxyサーバー経由される予定の通信が以下のうちどれにあてはまるかを教えてください。：

* **A:** Autify Connect ClientとAutify Connectサーバー間の通信
* **B:** Autify Connect Clientとテスト対象アプリケーション間の通信
* **C:** AとBの両方

#### 4-2. プロキシソフトウェア名

可能であれば、上記通信に使用されているプロキシソフトウェアの名称もご提供ください。

### 5. 使用しているCLI環境について

Terminal、PowerShellなど、どのCLI環境を使用しているか教えてください。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.autify.com/nocode-web/when-the-test-doesnt-work/common-errors/autify-connect-common-errors.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
