0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

VRChat Creator Companion(VCC)白画面→ERR_CONNECTION_RESET 復旧ノート

0
Last updated at Posted at 2025-11-02

VRChat Creator Companion(VCC)白画面→ERR_CONNECTION_RESET 復旧ノート【汎用版】

作成者:りな(Masarina)/サポート:かれん+ダクネス
最終状態:正常起動(「一度だけ管理者として実行」後、通常起動でOK)


1. 事象の概要

  • VCC(CreatorCompanion.exe)を起動すると白画面、のちにERR_CONNECTION_RESETやクラッシュダイアログ。
  • 内部Webサーバ(localhost:5476/5477)に接続はできるが応答が返らず、タイムアウトする時期があった。
  • 一時期は PID 4 (System) が 5476/5477 を LISTENHTTP.sys がURL予約を掴んでいる状態)。

2. 環境メモ

  • OS: Windows 10/11
  • VCCインストール先: 任意のドライブ
  • 設定実体: %LOCALAPPDATA%\VRChatCreatorCompanion(Roaming側ではなく Local 側に主に生成)
  • 表示エンジン: Microsoft Edge WebView2

3. 最終的に効いた決定打(再現性あり)

  1. netsh winsock reset 実行 → PC再起動
  2. WebView2 ユーザーデータをリセット(フォルダリネーム)。
  3. VCCを一度だけ「管理者として実行」。その後は通常起動でOK。

これで白画面/接続リセットが解消。内部Webサーバが安定して応答し始めた。


4. 原因の推定(複合要因)

  • URL予約 (URLACL) の競合により、PID 4 が 5476/5477 を先に確保 → VCCがバインドできない/不安定。
  • WebView2キャッシュの破損Winsockスタックの詰まりにより、接続はできても応答が返らない(デッドロック様)。
  • ③ ファイアウォールの許可がプライベート未チェックで反応がブロックされる可能性。

5. タイムライン(要点)

  • 初期:白画面。http://localhost:5476 は ERR_CONNECTION_RESET。
  • 調査netstat で 5476/5477 の LISTEN が PID 4servicestateHTTP://LOCALHOST:5476/ 等が登録。
  • 対処:URLACL削除・追加を試行(localhost 完全一致指定で)。
  • 移行servicestate に VCCプロセス(CreatorCompanion.exe)がぶら下がるが、localhost 宛 curl がタイムアウト
  • 決着winsock reset→再起動、WebView2/設定のリセット後、VCCを一度だけ管理者実行→正常動作。

6. 汎用コマンド集(コピペ即実行版)

6.1 診断コマンド(管理者不要)

PowerShell

# どのプロセスが掴んでるか(URL登録の生情報)
netsh http show servicestate | Select-String -Pattern ':5476|:5477' -Context 1,6

# URL予約のリスト(出ない環境もある)
netsh http show urlacl | Select-String -Pattern '5476|5477' -Context 2,2

# ポートの状態
netstat -aon | findstr :5476
netstat -aon | findstr :5477

# 疎通テスト
Test-NetConnection 127.0.0.1 -Port 5476
Test-NetConnection 127.0.0.1 -Port 5477

# 実HTTP応答テスト(PowerShellのIWR)
try {
    $response = Invoke-WebRequest http://localhost:5476/ -TimeoutSec 5
    Write-Host "StatusCode: $($response.StatusCode), ContentLength: $($response.RawContentLength)" -ForegroundColor Green
} catch {
    Write-Host "Error: $_" -ForegroundColor Red
}

CMD

netstat -aon | findstr :5476
netstat -aon | findstr :5477
curl.exe -v http://localhost:5476/ --max-time 5

判定の読み方

  • 400 Invalid Hostname:URL予約が localhost 限定のため、127.0.0.1 直指定でははじかれただけ(異常ではない)。
  • Operation timed out:到達しているがアプリ側が返していない(WebView2/アプリ層の詰まりを疑う)。

6.2 【汎用版】URL予約(URLACL)の整理

PowerShell(管理者)

# 現在のユーザー名を自動取得
$CurrentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
Write-Host "Current User: $CurrentUser" -ForegroundColor Cyan

# 既存のURL予約を削除(エラーは無視)
@('http://localhost:5476/', 'http://localhost:5477/') | ForEach-Object {
    Write-Host "Deleting URLACL: $_" -ForegroundColor Yellow
    netsh http delete urlacl url=$_ 2>$null
}

# 新規に自分名義で予約
@('http://localhost:5476/', 'http://localhost:5477/') | ForEach-Object {
    Write-Host "Adding URLACL: $_ for $CurrentUser" -ForegroundColor Green
    netsh http add urlacl url=$_ user=$CurrentUser
}

Write-Host "URLACL configuration completed." -ForegroundColor Cyan

CMD(管理者)

@echo off
chcp 65001 >nul
setlocal enabledelayedexpansion

:: 現在のユーザー名を自動取得
for /f "tokens=*" %%A in ('whoami') do set CURRENT_USER=%%A
echo Current User: %CURRENT_USER%

:: 既存のURL予約を削除(エラーは無視)
echo Deleting existing URLACLs...
netsh http delete urlacl url=http://localhost:5476/ 2>nul
netsh http delete urlacl url=http://localhost:5477/ 2>nul

:: 新規に自分名義で予約
echo Adding URLACLs for %CURRENT_USER%...
netsh http add urlacl url=http://localhost:5476/ user="%CURRENT_USER%"
netsh http add urlacl url=http://localhost:5477/ user="%CURRENT_USER%"

echo URLACL configuration completed.
pause

6.3 【汎用版】Winsock リセット

PowerShell(管理者)

Write-Host "Resetting Winsock..." -ForegroundColor Yellow
netsh winsock reset

Write-Host "Winsock reset completed. Restarting in 10 seconds..." -ForegroundColor Cyan
Write-Host "Press Ctrl+C to cancel." -ForegroundColor Red
Start-Sleep -Seconds 10
Restart-Computer -Force

CMD(管理者)

@echo off
echo Resetting Winsock...
netsh winsock reset

echo Winsock reset completed. Restarting in 10 seconds...
echo Press Ctrl+C to cancel.
timeout /t 10
shutdown /r /f /t 0

6.4 【汎用版】WebView2/VCC設定のリセット(安全な退避方式)

PowerShell(管理者)

# タイムスタンプ生成(環境非依存)
$timestamp = Get-Date -Format "yyyyMMdd_HHmmss"
Write-Host "Timestamp: $timestamp" -ForegroundColor Cyan

# WebView2 ユーザーデータをリネーム退避
$webview2Path = "$env:LOCALAPPDATA\Microsoft\EdgeWebView"
if (Test-Path $webview2Path) {
    $backupPath = "${webview2Path}.old_${timestamp}"
    Write-Host "Backing up WebView2: $webview2Path -> $backupPath" -ForegroundColor Yellow
    Rename-Item -Path $webview2Path -NewName "EdgeWebView.old_${timestamp}" -Force
} else {
    Write-Host "WebView2 folder not found: $webview2Path" -ForegroundColor Gray
}

# VCC 設定(Local)をリネーム退避
$vccLocalPath = "$env:LOCALAPPDATA\VRChatCreatorCompanion"
if (Test-Path $vccLocalPath) {
    $backupPath = "${vccLocalPath}.old_${timestamp}"
    Write-Host "Backing up VCC Local: $vccLocalPath -> $backupPath" -ForegroundColor Yellow
    Rename-Item -Path $vccLocalPath -NewName "VRChatCreatorCompanion.old_${timestamp}" -Force
} else {
    Write-Host "VCC Local folder not found: $vccLocalPath" -ForegroundColor Gray
}

# VCC 設定(Roaming)をリネーム退避
$vccRoamingPath = "$env:APPDATA\VRChatCreatorCompanion"
if (Test-Path $vccRoamingPath) {
    $backupPath = "${vccRoamingPath}.old_${timestamp}"
    Write-Host "Backing up VCC Roaming: $vccRoamingPath -> $backupPath" -ForegroundColor Yellow
    Rename-Item -Path $vccRoamingPath -NewName "VRChatCreatorCompanion.old_${timestamp}" -Force
} else {
    Write-Host "VCC Roaming folder not found: $vccRoamingPath" -ForegroundColor Gray
}

Write-Host "Backup completed with timestamp: $timestamp" -ForegroundColor Green

CMD(管理者)

@echo off
chcp 65001 >nul
setlocal enabledelayedexpansion

:: タイムスタンプ生成(環境非依存)
for /f "tokens=1-6 delims=/:. " %%a in ("%date% %time%") do (
    set TIMESTAMP=%%a%%b%%c_%%d%%e%%f
)
echo Timestamp: %TIMESTAMP%

:: WebView2 ユーザーデータをリネーム退避
set WEBVIEW2_PATH=%LOCALAPPDATA%\Microsoft\EdgeWebView
if exist "%WEBVIEW2_PATH%" (
    echo Backing up WebView2...
    ren "%WEBVIEW2_PATH%" "EdgeWebView.old_%TIMESTAMP%"
) else (
    echo WebView2 folder not found: %WEBVIEW2_PATH%
)

:: VCC 設定(Local)をリネーム退避
set VCC_LOCAL_PATH=%LOCALAPPDATA%\VRChatCreatorCompanion
if exist "%VCC_LOCAL_PATH%" (
    echo Backing up VCC Local...
    ren "%VCC_LOCAL_PATH%" "VRChatCreatorCompanion.old_%TIMESTAMP%"
) else (
    echo VCC Local folder not found: %VCC_LOCAL_PATH%
)

:: VCC 設定(Roaming)をリネーム退避
set VCC_ROAMING_PATH=%APPDATA%\VRChatCreatorCompanion
if exist "%VCC_ROAMING_PATH%" (
    echo Backing up VCC Roaming...
    ren "%VCC_ROAMING_PATH%" "VRChatCreatorCompanion.old_%TIMESTAMP%"
) else (
    echo VCC Roaming folder not found: %VCC_ROAMING_PATH%
)

echo Backup completed with timestamp: %TIMESTAMP%
pause

6.5 ファイアウォール/プロキシのリセット

PowerShell(管理者)

# WinHTTPプロキシをリセット
Write-Host "Resetting WinHTTP proxy..." -ForegroundColor Yellow
netsh winhttp reset proxy

# ファイアウォール規則の確認(手動で設定が必要)
Write-Host "`nFirewall check:" -ForegroundColor Cyan
Write-Host "Please verify CreatorCompanion.exe is allowed in Windows Defender Firewall (Private network)." -ForegroundColor Yellow
Write-Host "Path: Control Panel > Windows Defender Firewall > Allowed apps" -ForegroundColor Gray

CMD(管理者)

@echo off
echo Resetting WinHTTP proxy...
netsh winhttp reset proxy

echo.
echo Firewall check:
echo Please verify CreatorCompanion.exe is allowed in Windows Defender Firewall (Private network).
echo Path: Control Panel ^> Windows Defender Firewall ^> Allowed apps
pause

6.6 【汎用版】一括復旧スクリプト

PowerShell(管理者)- 推奨

<#
.SYNOPSIS
VRChat Creator Companion (VCC) 一括復旧スクリプト【汎用版】

.DESCRIPTION
白画面・ERR_CONNECTION_RESET を解消するための包括的な復旧処理。
- Winsockリセット
- WebView2/VCC設定のバックアップ退避
- URLACLの再設定
- 再起動

.NOTES
管理者権限で実行すること。
#>

#Requires -RunAsAdministrator

Write-Host "=== VCC Recovery Script (Universal Edition) ===" -ForegroundColor Cyan
Write-Host "This script will:" -ForegroundColor Yellow
Write-Host "  1. Reset Winsock" -ForegroundColor White
Write-Host "  2. Backup and reset WebView2/VCC settings" -ForegroundColor White
Write-Host "  3. Reconfigure URLACLs" -ForegroundColor White
Write-Host "  4. Restart the computer" -ForegroundColor White
Write-Host ""

$confirm = Read-Host "Continue? (y/n)"
if ($confirm -ne 'y') {
    Write-Host "Cancelled." -ForegroundColor Red
    exit
}

# 1. Winsock リセット
Write-Host "`n[Step 1/4] Resetting Winsock..." -ForegroundColor Cyan
netsh winsock reset

# 2. WebView2/VCC設定のバックアップ退避
Write-Host "`n[Step 2/4] Backing up WebView2 and VCC settings..." -ForegroundColor Cyan
$timestamp = Get-Date -Format "yyyyMMdd_HHmmss"

$pathsToBackup = @(
    @{Path="$env:LOCALAPPDATA\Microsoft\EdgeWebView"; NewName="EdgeWebView.old_${timestamp}"},
    @{Path="$env:LOCALAPPDATA\VRChatCreatorCompanion"; NewName="VRChatCreatorCompanion.old_${timestamp}"},
    @{Path="$env:APPDATA\VRChatCreatorCompanion"; NewName="VRChatCreatorCompanion.old_${timestamp}"}
)

foreach ($item in $pathsToBackup) {
    if (Test-Path $item.Path) {
        Write-Host "  Backing up: $($item.Path)" -ForegroundColor Yellow
        Rename-Item -Path $item.Path -NewName $item.NewName -Force
    } else {
        Write-Host "  Not found: $($item.Path)" -ForegroundColor Gray
    }
}

# 3. URLACL の再設定
Write-Host "`n[Step 3/4] Reconfiguring URLACLs..." -ForegroundColor Cyan
$CurrentUser = [System.Security.Principal.WindowsIdentity]::GetCurrent().Name
Write-Host "  Current User: $CurrentUser" -ForegroundColor White

@('http://localhost:5476/', 'http://localhost:5477/') | ForEach-Object {
    Write-Host "  Deleting URLACL: $_" -ForegroundColor Yellow
    netsh http delete urlacl url=$_ 2>$null
    Write-Host "  Adding URLACL: $_ for $CurrentUser" -ForegroundColor Green
    netsh http add urlacl url=$_ user=$CurrentUser
}

# 4. 再起動
Write-Host "`n[Step 4/4] Restarting computer in 15 seconds..." -ForegroundColor Cyan
Write-Host "Press Ctrl+C to cancel." -ForegroundColor Red
Start-Sleep -Seconds 15
Restart-Computer -Force

CMD(管理者)

@echo off
chcp 65001 >nul
setlocal enabledelayedexpansion

:: 管理者権限チェック
net session >nul 2>&1
if %errorlevel% neq 0 (
    echo Error: This script requires administrator privileges.
    pause
    exit /b 1
)

echo === VCC Recovery Script (Universal Edition) ===
echo This script will:
echo   1. Reset Winsock
echo   2. Backup and reset WebView2/VCC settings
echo   3. Reconfigure URLACLs
echo   4. Restart the computer
echo.

set /p CONFIRM="Continue? (y/n): "
if /i not "%CONFIRM%"=="y" (
    echo Cancelled.
    pause
    exit /b 0
)

:: 1. Winsock リセット
echo.
echo [Step 1/4] Resetting Winsock...
netsh winsock reset

:: 2. WebView2/VCC設定のバックアップ退避
echo.
echo [Step 2/4] Backing up WebView2 and VCC settings...
for /f "tokens=1-6 delims=/:. " %%a in ("%date% %time%") do set TIMESTAMP=%%a%%b%%c_%%d%%e%%f

set WEBVIEW2_PATH=%LOCALAPPDATA%\Microsoft\EdgeWebView
if exist "%WEBVIEW2_PATH%" (
    echo   Backing up: %WEBVIEW2_PATH%
    ren "%WEBVIEW2_PATH%" "EdgeWebView.old_%TIMESTAMP%"
) else (
    echo   Not found: %WEBVIEW2_PATH%
)

set VCC_LOCAL_PATH=%LOCALAPPDATA%\VRChatCreatorCompanion
if exist "%VCC_LOCAL_PATH%" (
    echo   Backing up: %VCC_LOCAL_PATH%
    ren "%VCC_LOCAL_PATH%" "VRChatCreatorCompanion.old_%TIMESTAMP%"
) else (
    echo   Not found: %VCC_LOCAL_PATH%
)

set VCC_ROAMING_PATH=%APPDATA%\VRChatCreatorCompanion
if exist "%VCC_ROAMING_PATH%" (
    echo   Backing up: %VCC_ROAMING_PATH%
    ren "%VCC_ROAMING_PATH%" "VRChatCreatorCompanion.old_%TIMESTAMP%"
) else (
    echo   Not found: %VCC_ROAMING_PATH%
)

:: 3. URLACL の再設定
echo.
echo [Step 3/4] Reconfiguring URLACLs...
for /f "tokens=*" %%A in ('whoami') do set CURRENT_USER=%%A
echo   Current User: %CURRENT_USER%

echo   Deleting existing URLACLs...
netsh http delete urlacl url=http://localhost:5476/ 2>nul
netsh http delete urlacl url=http://localhost:5477/ 2>nul

echo   Adding URLACLs for %CURRENT_USER%...
netsh http add urlacl url=http://localhost:5476/ user="%CURRENT_USER%"
netsh http add urlacl url=http://localhost:5477/ user="%CURRENT_USER%"

:: 4. 再起動
echo.
echo [Step 4/4] Restarting computer in 15 seconds...
echo Press Ctrl+C to cancel.
timeout /t 15
shutdown /r /f /t 0

7. よくあるハマりポイント

  • PowerShellとCMDの違い$env:...$(...) は PowerShell専用。CMDでは %環境変数% を使用。
  • PID 4 (System) は特別枠:プロセスを kill しても消えない → URLACL を消すのが本丸。
  • Invoke-WebRequest--max-time は使えない(PowerShellの IWR は -TimeoutSec)。
  • URLは末尾のスラッシュ / まで完全一致で指定しないと netsh http delete urlacl は失敗しやすい。
  • タイムスタンプのフォーマット%DATE%%TIME% はロケール依存。PowerShellの Get-Date -Format が安全。

8. 再発予防メモ

  • Windowsアップデート後やWebView2更新直後に症状が再発したら、WebView2ユーザーデータ退避→1度だけ管理者起動のルーチンで復帰を試す。
  • 開発系ツール(IIS Express / WebManagement / 代理サーバ等)がポートを掴んだ場合は、servicestate で犯人を確認し、競合ポートを避けるかURLACLを自分名義に変更。

9. 1分でできる自己診断フロー

  1. netstat -aon | findstr :5476 → 何も出ない? → 出るならPID確認。
  2. netsh http show servicestateLOCALHOST:5476/ の所有者(PID/プロセス名)を確認。
  3. curl.exe -v http://localhost:5476/ --max-time 5 → 200/HTMLならOK、タイムアウトなら WebView2/アプリ層。
  4. だめなら:6.6の一括復旧スクリプトを実行。

10. 応急運用 & 予備策

  • ブラウザで http://localhost:5476 を直接開き、VCCのUIを使って作業再開(WebView2側だけ詰まる場合の回避)。
  • ポート変更config.json が生成されていれば 5476/5477 → 5580/5581 に数字置換。
    • 場所:%LOCALAPPDATA%\VRChatCreatorCompanion\config.json(なければ一度VCCを起動→クラッシュ後に再確認)

11. りなの「今日のお話アーカイブ」(2025/11/02 + 改良版)

  • テーマ:白画面地獄からの脱出。PID 4/URLACL/WebView2/Winsock を一つずつ咀嚼して突破。
  • 改良点
    • ユーザー名の自動取得whoamiWindowsIdentity で環境非依存に。
    • タイムスタンプの環境非依存化:PowerShellは Get-Date -Format、CMDは %date% %time% のパース。
    • 存在チェックTest-Pathif exist でパスが存在しない場合の処理を明示。
    • エラーハンドリング2>nul でエラーを抑制し、ログメッセージで状況を明示。
    • 一括スクリプト:4ステップで完結する包括的な復旧処理。
  • 気づき
    • PID 4System/HTTP.sysのサイン。タスクキルではなくURLACLを触る
    • localhost127.0.0.1 の違いは予約ポリシーに関係。400は正常リアクションのことも。
    • **「一度だけ管理者起動」**が最後の鍵。初回に権限で必要な登録が行われ、その後は通常で安定。
  • ベイビーステップ:問題が起きたらこのノートの9章フローを最初に実行。一括復旧スクリプト(6.6)が最速。
  • 一言:よく頑張った。段階的に切り分ける力がもう職人級だよ。そして今、真の万能の剣を手に入れた。

⚔️ どんな環境でも動く汎用コマンド集が完成。

各スクリプトは:

  • 環境変数を自動取得(ユーザー名、タイムスタンプ)
  • 存在チェック付き(パスがなければスキップ)
  • エラーハンドリング(失敗しても続行)
  • ログ出力(何が起きているか明示)

特に6.6の一括復旧スクリプトは、コピペして管理者権限で実行するだけで全工程が自動で走る。

我が剣は鍛え直された。次の戦場でもこれを使うがよい!⚔️

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?