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

UnicodeDecodeError in optuna 3.5.0 with db.sqlite3 storage #5248

Open
HDembinski opened this issue Feb 13, 2024 · 4 comments
Open

UnicodeDecodeError in optuna 3.5.0 with db.sqlite3 storage #5248

HDembinski opened this issue Feb 13, 2024 · 4 comments
Labels
enhancement Change that does not break compatibility and not affect public interfaces, but improves performance.

Comments

@HDembinski
Copy link

HDembinski commented Feb 13, 2024

Expected behavior

As newbie on optuna, I wrongly tried to use this call in the CLI, where db.sqlite3 is a file on my drive in the same folder.

optuna --storage db.sqlite3 study-names

This call currently gives a complicated error message about a UnicodeDecodeError that does not indicate the true mistake; I should have used the full URL sqlite:///db.sqlite3. For me it is not obvious that I have to use this URL, and I expected this simpler call to work. I propose two solutions, with preference in that order:

  1. For user convenience, make the call above work: optuna detects that db.sqlite3 is the path to a filename and handles this call correctly.
  2. Optuna should detect that the storage is given without an URL prefix and complain with an error message that points the user towards this issue.
@HDembinski HDembinski added the bug Issue/PR about behavior that is broken. Not for typos/examples/CI/test but for Optuna itself. label Feb 13, 2024
@nzw0301
Copy link
Member

nzw0301 commented Feb 13, 2024

According to the first line of the log message, I suspect the CLI reads the SQLite file as journal storage. Could you try either way

optuna --storage sqlite:///db.sqlite3 study-names

or

optuna --storage db.sqlite3 --storage-class RDBStorage study-names

EDIT: sorry the second example does not work. Could you try only the first one?

@nzw0301 nzw0301 closed this as completed Feb 14, 2024
@nzw0301 nzw0301 added question Question about Optuna. and removed bug Issue/PR about behavior that is broken. Not for typos/examples/CI/test but for Optuna itself. labels Feb 14, 2024
@HDembinski
Copy link
Author

Thank you for the fix, the first line works. Still, I think this a UX bug. Please provide an error message for this case which points the user in the right direction or make the CLI smarter to handle the call optuna --storage db.sqlite3 study-names correctly. You should not expect that your users are familiar with the details of sqlite.

@nzw0301
Copy link
Member

nzw0301 commented Feb 14, 2024

Thank you for your input. Could you update the title and description? Then I will re-open this issue and change the label to a more appropriate one.

@HDembinski
Copy link
Author

Thanks, ok, done.

@nzw0301 nzw0301 reopened this Feb 15, 2024
@nzw0301 nzw0301 added enhancement Change that does not break compatibility and not affect public interfaces, but improves performance. and removed question Question about Optuna. labels Feb 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Change that does not break compatibility and not affect public interfaces, but improves performance.
Projects
None yet
Development

No branches or pull requests

2 participants