yoga-image-optimizer icon indicating copy to clipboard operation
yoga-image-optimizer copied to clipboard

Freeze at "In Progress"

Open kycfree1 opened this issue 1 year ago • 6 comments

Conversion status freezes at "In Progress". Conversions are never completed.

The issue only occurred since the latest 1.1.2 update (flatpak)

Encountered the same issue on fully updated versions of both PopOs & Manjaro.

kycfree1 avatar Sep 30 '22 14:09 kycfree1

Hello,

Thank you for the report! Can you run the app from a terminal to see if there is some logs?

To run the Flatpak version from the cli, the command is:

flatpak run org.flozz.yoga-image-optimizer

flozz avatar Sep 30 '22 14:09 flozz

Gtk-Message: 20:13:06.954: Failed to load module "appmenu-gtk-module" Gtk-Message: 20:13:07.037: Failed to load module "canberra-gtk-module"

/usr/include/c++/12.1.0/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator [with _Tp = float; _Alloc = std::allocator; reference = float&; size_type = long unsigned int]: Assertion '__n < this->size()' failed. Traceback (most recent call last): File "/app/lib/python3.10/site-packages/yoga_image_optimizer/application.py", line 270, in _update_optimization_status output_size = os.stat(image_data["output_file"]).st_size FileNotFoundError: [Errno 2] No such file or directory:

kycfree1 avatar Sep 30 '22 19:09 kycfree1

Thank you for the logs.

It seems that an error occurred during the optimization of one of the images, and when the thread returns, the main process crash because the output file is missing.

The errors raised in optimization threads were not handled at all by YOGA Image Optimizer 1.1.2, so it is not possible to know what is the problem (but probably a corrupted image or maybe the system had gone out of memory). I already improved this on the master branch: now errors in optimization threads are reported in the logs and it does not crash the whole optimization process anymore.

TL;DR: The next version of YOGA Image Optimizer (and the current master branch) should fix your problem. I have some more fix to work on but I hope being able to release a new version of YOGA Image Optimizer soon :)

Capture d’écran du 2022-09-28 13-34-38

flozz avatar Oct 01 '22 11:10 flozz

It is a very strange issue. I did try numerous different images located in different locations of my filesystem and encountered the same problem. I then installed on my Manjaro workstation and encountered the identical issue. Unfortely flatpak doesn't allow me to downgrade to previous version so I'll wait on the update and use gThumb in the meantime. Thank you

kycfree1 avatar Oct 01 '22 19:10 kycfree1

Maybe this is a similar issue? Error encountered in Python 3.7.14. No issue in 3.10.7 though. Manage different Python versions using pyenv.

Steps to reproduce:

git clone https://github.com/flozz/yoga-image-optimizer.git
cd yoga-image-optimizer
sudo pip3 install .

Stacktrace:

$ yoga-image-optimizer
...
Exception in thread QueueManagerThread:
Traceback (most recent call last):
  File "/home/foobar/.pyenv/versions/3.7.14/lib/python3.7/threading.py", line 926, in _bootstrap_inner                                                                                     self.run()
  File "/home/foobar/.pyenv/versions/3.7.14/lib/python3.7/threading.py", line 870, in run self._target(*self._args, **self._kwargs)                                               File "/home/foobar/.pyenv/versions/3.7.14/lib/python3.7/concurrent/futures/process.py", line 375, in _queue_management_worker
    thread_wakeup.clear()                                                                   File "/home/foobar/.pyenv/versions/3.7.14/lib/python3.7/concurrent/futures/process.py", line 93, in clear
    while self._reader.poll():
  File "/home/foobar/.pyenv/versions/3.7.14/lib/python3.7/multiprocessing/connection.py", line 255, in poll
    self._check_closed()
  File "/home/foobar/.pyenv/versions/3.7.14/lib/python3.7/multiprocessing/connection.py", line 136, in _check_closed
    raise OSError("handle is closed")
OSError: handle is closed

Traceback (most recent call last):
  File "/home/foobar/.pyenv/versions/3.7.14/lib/python3.7/site-packages/yoga_image_optimizer/main_window.py", line 385, in _on_main_window_destroyed
    app.quit()
  File "/home/foobar/.pyenv/versions/3.7.14/lib/python3.7/site-packages/yoga_image_optimizer/application.py", line 142, in quit
    self._thumbnailer.cancel_all()
  File "/home/foobar/.pyenv/versions/3.7.14/lib/python3.7/site-packages/yoga_image_optimizer/thumbnailer.py", line 156, in cancel_all
    self._executor.shutdown(wait=False, cancel_futures=True)
TypeError: shutdown() got an unexpected keyword argument 'cancel_futures'

kianmeng avatar Oct 13 '22 18:10 kianmeng

@kianmeng It is a different error, probably related to API changes in concurrent.futures. I opened a new issue to track this bug. Nice catch! :)

flozz avatar Oct 14 '22 06:10 flozz

This error

/usr/include/c++/12.1.0/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator [with _Tp = float; _Alloc = std::allocator; reference = float&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.

Was in fact caused by a bug in the Gutezli library and the assertion error occurred only in the Flatpak package. More information in this other bug:

https://github.com/flozz/yoga-image-optimizer/issues/35

The Guetzli bug is now fixed, Pygutzli was patched and updated and the YOGA Image Optimizer Flatpak package has been updated :)

flozz avatar Nov 03 '22 08:11 flozz