Sui CLI V1.60 Bug: Client Config Overwritten On Upgrade
Hey guys! It looks like some Windows users are encountering a nasty bug after upgrading their Sui CLI to version 1.60. This issue causes the client.yaml configuration file to be overwritten with an empty file, making the Sui client unusable. Let's dive into the details and explore what's happening.
The Problem: Empty client.yaml After Upgrade
After upgrading to v1.60 from v1.59 using Chocolatey, users have reported that their ~/.sui/sui_config/client.yaml file becomes empty. This file is crucial for the Sui client as it stores important configuration details, such as the RPC endpoint and wallet information. This issue effectively prevents users from performing any sui client operations, as the client can no longer access the necessary configuration.
Error Message
When attempting to use the Sui client, the following error message appears:
Cannot open wallet config file at "C:\Users\...\.sui\sui_config\client.yaml". Err: EOF while parsing a value
This error indicates that the client is trying to read the client.yaml file, but it encounters the "End of File" (EOF) error while parsing, because the file is empty. This is a clear sign that the configuration has been wiped out.
Attempts to Fix the Issue
Unfortunately, simply manually editing the client.yaml file to restore the previous configuration doesn't solve the problem. The file gets overwritten with an empty file again immediately after performing any sui client operation. This makes it incredibly difficult to recover from the issue and continue using the Sui CLI.
Steps to Reproduce the Issue
To reproduce this bug, follow these steps:
- Have a working Sui CLI installation on Windows (version 1.59 or earlier).
- Upgrade to version 1.60 using Chocolatey.
- Attempt to perform any
sui clientoperation.
If you encounter the error message mentioned above, it's likely that you've run into this bug. This issue seems to be specific to Windows users who upgrade via Chocolatey.
System Information
This issue has been reported on the following system:
- OS: Windows 11 Pro 24H2 (Build 26100.6899)
It's possible that other versions of Windows may also be affected. If you're experiencing this issue on a different operating system, please let us know!
Possible Causes and Solutions
While the exact cause of this bug is still under investigation, here are a few potential reasons and solutions:
1. Permissions Issue
It's possible that the Sui CLI doesn't have the necessary permissions to write to the client.yaml file after the upgrade. This could be due to changes in the way Chocolatey handles permissions or a conflict with existing user permissions.
Solution:
- Try running the Sui CLI with administrator privileges. Right-click on the command prompt or PowerShell icon and select "Run as administrator."
- Check the permissions of the
~/.sui/sui_configdirectory and theclient.yamlfile. Ensure that your user account has read and write access.
2. Configuration Migration Bug
There might be a bug in the upgrade process that prevents the migration of the existing configuration to the new version. This could result in the client.yaml file being overwritten with a default (empty) configuration.
Solution:
- Unfortunately, there's no easy workaround for this if it's a bug in the migration process. The best course of action is to wait for an official fix from the Sui team.
- As a temporary solution, you could try backing up your
client.yamlfile before upgrading and restoring it manually after the upgrade. However, as mentioned earlier, this might not work as the file gets overwritten immediately.
3. Chocolatey Package Issue
It's also possible that the Chocolatey package for Sui CLI v1.60 has a problem that causes the configuration file to be corrupted or deleted during the upgrade process. This could be due to a faulty script or incorrect file handling within the package.
Solution:
- Check the Chocolatey package page for any reported issues or updates. If there's a known problem with the package, the maintainers might release a fix soon.
- Consider using an alternative installation method, such as downloading the binary directly from the Sui website or using a different package manager.
Workarounds and Temporary Solutions
While we wait for a permanent fix, here are some workarounds that might help you get your Sui CLI working again:
1. Reinstall Sui CLI
Uninstalling and reinstalling the Sui CLI might resolve the issue by creating a fresh configuration file. However, keep in mind that this will also remove any existing keys and configurations, so make sure to back them up first.
Steps:
- Uninstall the Sui CLI using Chocolatey:
choco uninstall sui - Delete the
~/.suidirectory (after backing up any important files). - Reinstall the Sui CLI using Chocolatey:
choco install sui - Configure the Sui client again using
sui client new-envand other relevant commands.
2. Use a Different Installation Method
As mentioned earlier, the issue might be specific to the Chocolatey package. Try installing the Sui CLI using a different method, such as:
- Downloading the binary from the Sui website and adding it to your system's PATH.
- Using a different package manager (if available).
This can help you bypass any potential issues with the Chocolatey package.
3. Wait for a Fix
The most reliable solution is to wait for the Sui team to release a fix for this bug. Keep an eye on the Sui Discord channel and GitHub repository for updates. The Sui team is actively investigating this issue, and a fix should be available soon.
Reporting the Issue
If you're experiencing this bug, please report it to the Sui team. You can do this by:
- Joining the Sui Discord channel and reporting the issue in the appropriate channel.
- Creating an issue on the Sui GitHub repository.
When reporting the issue, please include the following information:
- Your operating system and version.
- The Sui CLI version you're using.
- The steps you took to reproduce the issue.
- Any error messages you're seeing.
This will help the Sui team diagnose and fix the bug more quickly.
Conclusion
The Sui CLI v1.60 bug that overwrites the client.yaml configuration file is a frustrating issue for Windows users. While the exact cause is still being investigated, there are several potential solutions and workarounds you can try. The most important thing is to report the issue to the Sui team and wait for an official fix.
In the meantime, try the workarounds mentioned in this article, such as reinstalling the Sui CLI or using a different installation method. Stay tuned for updates from the Sui team, and we'll keep you informed as we learn more.
Thanks for reading, and happy building on Sui!