Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now
During the refresh of Power BI Report Server, an error may occasionally occur with the following message: {"SessionID":"870bb50f-364e-47b3-8eb3-a3c624367dd3","Errors":[{"ErrorCode":-1054998449,"Message":"Unexpected number of disk files associated with database object. Possible cause for that is missing or corrupt cryptokey.bin or detach.log file.","CallStack":null}]}
What specific reasons lead to this issue?
Why does this error occur intermittently?
How can it be resolved?
The error message “missing or corrupt cryptokey.bin or detach.log file” when refreshing Power BI Report Server indicates an issue with the server's encryption keys or database files. Here’s an explanation of possible causes, why it may be intermittent, and steps for resolution:
Causes of the Error
1. Corrupted or Missing Encryption Key File:
- Power BI Report Server uses encryption keys to protect sensitive data, like stored credentials for data sources. The `cryptokey.bin` file stores these encryption keys. If this file is missing or corrupt, Power BI Report Server cannot access these encrypted credentials, leading to errors.
2. Incomplete Backup or Restore Process:
- If there was a recent backup or restore of Power BI Report Server, it may not have restored the encryption keys or log files correctly. This can cause missing or corrupt files, such as `detach.log` or `cryptokey.bin`, leading to this issue.
3. Disk or Storage Issues:
- Intermittent issues can be caused by underlying storage issues, like disk corruption, permission issues, or network instability. If Power BI Report Server cannot reliably access its files, it may intermittently encounter errors.
4. Inconsistent Database File States:
- Power BI Report Server relies on several files for each database (e.g., .bin, .log) to maintain data integrity. If one or more of these files are out of sync or partially corrupt, the system may throw this error intermittently.
Why This Error is Intermittent
- Server Load or Resource Availability: If the server is under heavy load or running low on resources, file access might fail occasionally. This can lead to intermittent issues with accessing necessary files.
- Network or Storage Connectivity Fluctuations: If the files are on network storage, any brief network drop or latency can cause intermittent access issues.
- Fluctuations in Report Demand: If certain reports require specific encrypted credentials, the error might appear only when those reports are refreshed. This can make the issue appear sporadic, especially if the affected reports are refreshed at different times.
Steps to Resolve the Issue
1. Check Disk Integrity and File Permissions:
- Verify the integrity of the disk where Power BI Report Server files are stored. Run checks for disk corruption and ensure that the Power BI Report Server service account has full access to the relevant directories.
2. Back Up and Restore Encryption Keys:
- Go to Power BI Report Server Configuration Manager> Encryption Keys. Take a backup of the current encryption keys if you haven’t already. If the error persists, you may need to restore the keys from a previous backup.
- Important: Restoring encryption keys can affect data source credentials. Make sure you have the credentials for all data sources before restoring.
3. Regenerate Encryption Keys (if necessary):
- If you don’t have a backup or the issue persists after restoring, you may need to delete and regenerate the encryption keys. This can be done in the Encryption Keys section of the Configuration Manager.
- Caution: This will remove all encrypted credentials, so you’ll need to re-enter the data source credentials for all reports afterward.
4. Review Database File State:
- Ensure that all related files (.bin, .log, etc.) are present and intact. If the files were restored from a backup, ensure that the restore process was complete and that no files were skipped or corrupted.
5. Monitor for Consistent Failures:
- Since the issue is intermittent, try to observe if it occurs more frequently at specific times or under certain conditions (e.g., high server load). This can help narrow down underlying issues, such as disk or network performance problems.
6. Contact Microsoft Support (if unresolved):
- If none of the above steps resolve the issue, reach out to Microsoft support, as the error may be due to deeper issues within the Power BI Report Server installation or an environment-specific issue.
Summary of Steps
1. Check file integrity, permissions, and disk health.
2. Backup and, if necessary, restore or regenerate encryption keys.
3. Ensure all necessary files are present and accessible.
4. Monitor for patterns in the intermittent failures.
5. Contact Microsoft Support if needed.
By following these steps, you can address both the immediate error and any underlying causes, potentially improving overall server reliability.
I've never seen this, it could be a hardware issue on your server. I'd suggest raising a ticket with Microsoft support.
Check out the October 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.