optuna / optuna-dashboard

Real-time Web Dashboard for Optuna.
https://optuna-dashboard.readthedocs.io/en/latest/
Other
532 stars 90 forks source link

Bottle 0.13 breaks bundle.js #956

Closed christian-lanius closed 2 months ago

christian-lanius commented 2 months ago

With the latest version of bottle being released on 04.09.24, optuna-dashboard no longer functions. The encoding/zipping of the bundle.js file is broken, resulting in an error message in the browser: Uncaught SyntaxError: Invalid or unexpected token (at bundle.js:1:1):

image

Downgrading bottle to version 0.12.*

pip uninstall bottle
pip install bottle==0.12.*

fixes the issue. I suppose that this is the "quick" fix until optuna-dashboard can update the breaking changes, and could be adapted by forcing the bottle version in the requirements.txt

How to Reproduce

  1. setup a new virtual environment python3 -m venv env
  2. Activate it source env/bin/activate
  3. Install optuna-dashboard pip install optuna-dashboard
  4. Launch the dashboard optuna-dashboard --host 0.0.0.0 journal.log (journal.log can be an empty file)
  5. Open the dashboard in the browser

Python version

3.11

Optuna version

4.0.0

optuna-dashboard version or git revision

0.16.1

Web browser

Google Chrome, Firefox

c-bata commented 2 months ago

@christian-lanius Thank you for your report 🙏 It appears that this bug is likely caused by this commit: https://github.com/bottlepy/bottle/commit/ee61a68e8409ca3d57ae66f49f5f18a975a7d687. I'll address this issue next Monday.

charleskhazoom commented 2 months ago

Hi, even after downgrading to bottle 0.12.25, I still have the "now loading" issue.

I used optuna-dashboard --host 0.0.0.0 ./optuna_journal_storage.log to load it.

Python version 3.11.0

Optuna version 4.0.0

optuna-dashboard version or git revision 0.16.1

Web browser Google Chrome, Firefox

christian-lanius commented 2 months ago

@charleskhazoom can you check in the developer tools what the bundle.js looks like and if you get the error message that there is a syntax error in it?

charleskhazoom commented 2 months ago

OK I checked again. After downgrading to bottle 0.12.25, it works in firefox. It also works in Chrome but in "Guest mode". I suspect one of my personal chrome extensions might prevent the dashboard to load properly.

christian-lanius commented 2 months ago

Maybe there is an issue with the "broken" bundle.js being cached by your chrome instance. This might be resolved by right clicking the refresh button and selecting the "clear cache and force reload" (or similar) option.

charleskhazoom commented 2 months ago

Maybe there is an issue with the "broken" bundle.js being cached by your chrome instance. This might be resolved by right clicking the refresh button and selecting the "clear cache and force reload" (or similar) option.

You're right. Everything works after clearing the cache and reloading. Thank you !

unicorn343 commented 2 months ago

I've downgraded the bottle package to version 0.12, but optuna-dashboard works fine on firefox and chrome still shows "now loading".

christian-lanius commented 2 months ago

@unicorn343 probably the same issue that happened above: Can you clear cache and force reload in chrome by right clicking the refresh button and choosing the appropriate button?

c-bata commented 2 months ago

Sorry for the delay. I've just opened a PR #959 to resolve this issue. The next patch release is scheduled within 4 hours.

c-bata commented 2 months ago

@christian-lanius @unicorn343 @charleskhazoom I published the new patch release v0.16.2 that addresses this issue :pray: https://github.com/optuna/optuna-dashboard/releases/tag/v0.16.2

christian-lanius commented 2 months ago

@c-bata Thank you a lot for your quick patch for this issue!