トラブルシューティング

問題の説明 原因 解決策
パスワードが間違っていると復号に失敗します

Error: Decryption failed. Please check your password

  • パスワードが間違っています
  • 暗号化されたファイルが破損しています
  • 暗号化に別のパスワードが使用されています
  1. 正しいパスワードを使用して再試行するか、パスワードマネージャを確認します。
  2. ファイルが破損していないかを確認します。
    CODE
    # Unix - check file integrity
    file inputs.groovy.enc
    # Should show: "openssl enc'd data with salted password"
    
    # Check file size (should be > 0)
    ls -lh inputs.groovy.enc
  3. inputs.groovy プレーンテキストファイルのバックアップがある場合は、バックアップリカバリを実行します。
    CODE
    cp /backup/path/inputs.groovy .
    # Re-encrypt with known password
    ./synthetic-processor/bin/encrypt-file.sh encrypt inputs.groovy inputs.groovy.enc
    rm inputs.groovy
  4. inputs.groovy ファイルを再作成します。
    PYTHON
    # Create new inputs.groovy from sample
    cp inputs.groovy.sample inputs.groovy
    # Edit with correct credentials
    vim inputs.groovy
    # Encrypt with new password
    ./synthetic-processor/bin/encrypt-file.sh encrypt inputs.groovy inputs.groovy.enc
    rm inputs.groovy
操作後に再暗号化が失敗すると、次のエラーメッセージが表示されます。

WARNING: Re-encryption failed after 3 attempts. SECURITY RISK: Plaintext inputs.groovy remains on disk!

  • 再暗号化中のパスワード不一致
  • 暗号化中の OpenSSL エラー
  1. ファイルのステータスを確認します。
    CODE
    ls -la inputs.groovy*
                # You'll see both files:
                # -rw------- inputs.groovy      (plaintext - security risk!)
                # -rw------- inputs.groovy.enc  (old encrypted version)
  2. 手動で再暗号化します。

    CODE
    #' Unix
    ./synthetic-processor/bin/encrypt-file.sh encrypt inputs.groovy inputs.groovy.enc
    # Enter password carefully
    
    # Verify success
    echo $?  # Should be 0
    
    # Delete plaintext
    rm inputs.groovy
  3. 暗号化を検証します。
    CODE
    # Only encrypted file should remain
    ls -la inputs.groovy*
    # -rw------- inputs.groovy.enc
  4. 復号化を検証します。
    CODE
    # Test decryption
    ./synthetic-processor/bin/encrypt-file.sh decrypt inputs.groovy.enc inputs.groovy.test
    # Should succeed with correct password
    rm inputs.groovy.test
インストーラに「許可が拒否される」エラーが表示されます。

Permission denied: inputs.groovy.enc

  • ファイルは別のユーザーによって所有されています
  • 不十分な許可
  1. 所有権を確認します。
    CODE
    ls -l inputs.groovy.enc
    # -rw------- 1 otheruser group 1234 Dec 16 10:30 inputs.groovy.enc
  2. 権限を修正します(所有者またはルートとして)。
    CODE
    # Change ownership
    sudo chown $USER:$USER inputs.groovy.enc
    
    # Set correct permissions
    chmod 600 inputs.groovy.enc
  3. 正しいユーザーとして実行します。
    CODE
    # Switch to installation user
    su - installuser
    ./unix/deploy.sh update
inputs.groovy ファイルと inputs.groovy.enc ファイルが一緒に存在します -

診断を実行します。

CODE
# Check modification times
ls -lt inputs.groovy*
# -rw------- inputs.groovy.enc  (newer)
# -rw------- inputs.groovy      (older)

# Verify they match
./synthetic-processor/bin/encrypt-file.sh decrypt inputs.groovy.enc inputs.groovy.test
diff inputs.groovy inputs.groovy.test
# If output is empty, they match
rm inputs.groovy.test

Resolution:

CODE
# If encrypted version is current:
rm inputs.groovy  # Delete plaintext

# If plaintext was recently edited:
# Re-encrypt to update encrypted version
./synthetic-processor/bin/encrypt-file.sh encrypt inputs.groovy inputs.groovy.enc
rm inputs.groovy
暗号化スクリプトが見つかりません。

Error: Encryption script not found at /path/to/encrypt-file.sh

  • インストールパッケージが不完全です
  • ファイルが移動されるか削除されました
  • 誤ったディレクトリから実行しています
  1. インストール構成を検証します。
    CODE
    # Unix
    ls -la synthetic-processor/bin/encrypt-file.sh
    
    # Windows
    dir synthetic-processor\bin\encrypt-file.bat
  2. 実行権限を確認します(Unix)。
    CODE
    chmod +x synthetic-processor/bin/encrypt-file.sh
  3. 正しいディレクトリから実行します。
    PYTHON
    # Must run from synthetic-installer directory
    cd /path/to/synthetic-installer
    ./unix/deploy.sh update
  4. スクリプトが欠落している場合は、再インストールします。

    1. 新しいインストールパッケージを展開します。

    2. 欠落しているスクリプトを新しいパッケージからコピーします。

  • 暗号化は成功しましたが、復号に失敗しました
  • パスワードに関する動作が一貫していません

この問題は次の場合に発生することがあります。

  • パスワードに特殊文字が含まれている
  • シェルが特殊文字を解釈またはエンコードできない
暗号化には単純なパスワードを使用してください。
  • 次の文字は使用しないでください。 $`"'!
  • 次の文字が推奨されます。英字、数字、基本記号(@#%&-_
暗号化の問題のデバッグ -
  1. OpenSSL の詳細出力を有効にします。
    CODE
    # Temporarily edit encrypt-file.sh
    # Remove the '2>/dev/null' redirects to see full OpenSSL errors
    
    # Line 51 - Encryption:
    openssl enc -aes-256-cbc -salt -pbkdf2 -iter 100000 \
        -in "$input_file" \
        -out "$output_file"
    # (Remove: 2>/dev/null)
    
    # Line 77 - Decryption:
    openssl enc -aes-256-cbc -d -pbkdf2 -iter 100000 \
        -in "$input_file" \
        -out "$output_file"
    # (Remove: 2>/dev/null)
    
    # Run operation to see detailed error
    ./unix/deploy.sh update
  2. 暗号化を手動でテストします。
    CODE
    # Create test file
    echo "test content" > test.txt
    
    # Encrypt
    openssl enc -aes-256-cbc -salt -pbkdf2 -iter 100000 \
        -in test.txt -out test.enc
    
    # Decrypt
    openssl enc -aes-256-cbc -d -pbkdf2 -iter 100000 \
        -in test.enc -out test.dec
    
    # Compare
    diff test.txt test.dec
    # Should be identical
    
    # Cleanup
    rm test.txt test.enc test.dec
プレーンテキストから暗号化への移行

セキュリティ確保のため、既存のプレーンテキストファイルを暗号化する必要があります。

プレーンテキストを暗号化します。
  1. ファイルの暗号化:
    CODE
    ./synthetic-processor/bin/encrypt-file.sh encrypt inputs.groovy inputs.groovy.enc
  2. 確認:
    CODE
    # Test decryption
    ./synthetic-processor/bin/encrypt-file.sh decrypt inputs.groovy.enc inputs.groovy.test
    diff inputs.groovy inputs.groovy.test
    # Should be identical
    rm inputs.groovy.test
  3. プレーンテキストファイルを削除します。
    CODE
    rm inputs.groovy
  4. テスト操作:
    CODE
    # Ensure encrypted version works
    ./unix/deploy.sh start
    # Should prompt for password and work normally
パスワードを忘れた場合の回復 -
パスワードを完全に紛失した場合は、ログイン情報を再作成してください。
  1. サンプルから新しい inputs.groovy ファイルを作成します。
    CODE
    cp inputs.groovy.sample inputs.groovy
  2. ログイン情報の取得元:
    • データベースサーバー(ユーザーまたはパスワードを確認)
    • コントローラ(API ログイン情報を確認)
    • 構成のバックアップ
    • チームのドキュメント
  3. 正しい値で編集してください。
    CODE
    vim inputs.groovy
  4. 接続を手動でテストします。
    CODE
    mysql -h $db_host -u $db_username -p$db_user_pwd
  5. 新しいパスワードで暗号化します。
    CODE
    ./synthetic-processor/bin/encrypt-file.sh encrypt inputs.groovy inputs.groovy.enc
  6. 新しいパスワードを安全に保管します。

  7. 古い暗号化ファイルとプレーンテキストを削除します。
    CODE
    rm inputs.groovy.enc.old inputs.groovy