Troubleshooting

Issue Description Cause Solution
Decryption fails with wrong password

Error: Decryption failed. Please check your password

  • Incorrect password
  • Encrypted file corrupted
  • Different password used for encryption
  1. Try again with the correct password or check password manager.
  2. Check if the file is corrupted:
    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. Perform a backup recovery if you have a backup of inputs.groovy plaintext file:
    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. Recreate the inputs.groovy file:
    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
Re-encryption fails after operation and gives the following error message:

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

  • Password mismatch during re-encryption
  • OpenSSL error during encryption
  1. Check the file status:
    CODE
    ls -la inputs.groovy*
                # You'll see both files:
                # -rw------- inputs.groovy      (plaintext - security risk!)
                # -rw------- inputs.groovy.enc  (old encrypted version)
  2. Re-encrypt manually:

    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. Verify the encryption:
    CODE
    # Only encrypted file should remain
    ls -la inputs.groovy*
    # -rw------- inputs.groovy.enc
  4. Verify the decryption:
    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
Installer displays permission denied errors:

Permission denied: inputs.groovy.enc

  • File is owned by a different user
  • Insufficient permissions
  1. Check ownership:
    CODE
    ls -l inputs.groovy.enc
    # -rw------- 1 otheruser group 1234 Dec 16 10:30 inputs.groovy.enc
  2. Fix the permissions (as owner or root):
    CODE
    # Change ownership
    sudo chown $USER:$USER inputs.groovy.enc
    
    # Set correct permissions
    chmod 600 inputs.groovy.enc
  3. Run as correct user:
    CODE
    # Switch to installation user
    su - installuser
    ./unix/deploy.sh update
The inputs.groovy and inputs.groovy.enc files exist together -

Run a Diagnosis:

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
Encryption script not found:

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

  • Incomplete installation package
  • Files moved or deleted
  • Running from a wrong directory
  1. Verify the installation structure:
    CODE
    # Unix
    ls -la synthetic-processor/bin/encrypt-file.sh
    
    # Windows
    dir synthetic-processor\bin\encrypt-file.bat
  2. Check execution permissions (Unix):
    CODE
    chmod +x synthetic-processor/bin/encrypt-file.sh
  3. Run from the correct directory:
    PYTHON
    # Must run from synthetic-installer directory
    cd /path/to/synthetic-installer
    ./unix/deploy.sh update
  4. Reinstall if the script is missing:

    1. Extract the fresh installation package.

    2. Copy the missing scripts from the new package.

  • Encryption is successful but decryption fails
  • Inconsistent behavior with password

This issue can occur if:

  • the password contains special characters
  • there are Shell interpretation or encoding issues with special characters
Use simple passwords for encryption:
  • Avoid these characters: $, `,", ', !
  • Preferred characters: letters, numbers, basic symbols (@, #, %, &, -, _)
Debugging encryption issues -
  1. Enable verbose OpenSSL output:
    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. Test encryption manually:
    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
Migration from plaintext to encrypted

The existing plaintext file must be encrypted for security.

Migrate from plaintext to encrypted:
  1. Encrypt the file:
    CODE
    ./synthetic-processor/bin/encrypt-file.sh encrypt inputs.groovy inputs.groovy.enc
  2. Verify:
    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. Delete the plaintext file:
    CODE
    rm inputs.groovy
  4. Test operations:
    CODE
    # Ensure encrypted version works
    ./unix/deploy.sh start
    # Should prompt for password and work normally
Forgotten Password Recovery -
Recreate credentials if the password is lost permanently:
  1. Create a new inputs.groovy file from sample:
    CODE
    cp inputs.groovy.sample inputs.groovy
  2. Retrieve the credentials from:
    • Database server (check user or password)
    • Controller (check API credentials)
    • Configuration backups
    • Team documentation
  3. Edit with correct values:
    CODE
    vim inputs.groovy
  4. Test connectivity manually:
    CODE
    mysql -h $db_host -u $db_username -p$db_user_pwd
  5. Encrypt with the new password:
    CODE
    ./synthetic-processor/bin/encrypt-file.sh encrypt inputs.groovy inputs.groovy.enc
  6. Store the new password securely.

  7. Delete the old encrypted file and plaintext:
    CODE
    rm inputs.groovy.enc.old inputs.groovy