Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output a friendlier message on das cli #114

Open
levisingularity opened this issue Aug 28, 2024 · 3 comments
Open

Output a friendlier message on das cli #114

levisingularity opened this issue Aug 28, 2024 · 3 comments
Assignees

Comments

@levisingularity
Copy link
Collaborator

levisingularity commented Aug 28, 2024

Running the cli with a full disk we realize the system errors are not too friendly for the user as shown below:

$ das-cli db stop
[2071078] Cannot create temporary directory!
$ das-cli config list
[2071115] Cannot create temporary directory!
$ das-cli config set
[2071168] Cannot create temporary directory! 
@levisingularity levisingularity self-assigned this Aug 28, 2024
@levisingularity
Copy link
Collaborator Author

levisingularity commented Dec 12, 2024

@andre-senna Unfortunately, we can't modify this message because we're using PyInstaller to generate the binary. The single executable file includes an embedded archive containing all the Python modules used by the script, as well as compressed copies of non-Python support files (e.g., .so files). During execution, the PyInstaller bootloader unpacks these support files and writes them to a temporary folder. As a result, this error message is triggered even before our source code starts running, specifically during the extraction of the necessary files into the temporary folder. For more details, you can refer to the PyInstaller documentation on the subject:
PyInstaller Documentation

@andre-senna
Copy link
Contributor

Can we add something to the error message? For instance a new line with something like "Check directory permissions and space availability."

@levisingularity
Copy link
Collaborator Author

levisingularity commented Dec 12, 2024

@andre-senna Unfortunately, this cannot be done because it’s an error thrown by the wrapper itself, generated by PyInstaller. If you run the DAS-CLI as a script, you’ll see a message indicating that the disk is full. This behavior only occurs in the binary because, in the PyInstaller lifecycle, this error happens even before our Python code is executed. Our code only runs after the PyInstaller bootloader unpacks the support files and writes them to a temporary folder. Since the error occurs during this process, the message we see is actually a standard one generated by the wrapper created by PyInstaller. What we could do instead is perhaps add a note about this in the documentation for the DAS-CLI or something similar. What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants