LuteOrg / lute-v3

LUTE = Learning Using Texts: learn languages through reading.
https://luteorg.github.io/lute-manual/
MIT License
493 stars 46 forks source link

can't update 334MB audio file:No space left on device #432

Open kekeqwq opened 6 months ago

kekeqwq commented 6 months ago
MP3 File (.mp3)
334 MB (350,685,938 bytes)

drwxr-xr-x 8 keke keke 0 May 23 17:59 Lute3/
/dev/sda2        91G  873M   89G   1% /

Platform: Linux-6.9.1-arch1-1-x86_64-with-glibc2.39

Version: 3.4.1

In docker?: False

Stack trace:

Traceback (most recent call last):
  File "/home/keke/lute/envlute/lib/python3.12/site-packages/flask/app.py", line 1473, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/keke/lute/envlute/lib/python3.12/site-packages/flask/app.py", line 882, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/keke/lute/envlute/lib/python3.12/site-packages/flask/app.py", line 880, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/keke/lute/envlute/lib/python3.12/site-packages/flask/app.py", line 865, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/keke/lute/envlute/lib/python3.12/site-packages/lute/book/routes.py", line 104, in new
    form = NewBookForm(obj=b)
           ^^^^^^^^^^^^^^^^^^
  File "/home/keke/lute/envlute/lib/python3.12/site-packages/wtforms/form.py", line 208, in __call__
    return type.__call__(cls, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/keke/lute/envlute/lib/python3.12/site-packages/lute/book/forms.py", line 57, in __init__
    super().__init__(*args, **kwargs)
  File "/home/keke/lute/envlute/lib/python3.12/site-packages/flask_wtf/form.py", line 73, in __init__
    super().__init__(formdata=formdata, **kwargs)
  File "/home/keke/lute/envlute/lib/python3.12/site-packages/wtforms/form.py", line 286, in __init__
    self.process(formdata, obj, data=data, **kwargs)
  File "/home/keke/lute/envlute/lib/python3.12/site-packages/wtforms/form.py", line 106, in process
    formdata = self.meta.wrap_formdata(self, formdata)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/keke/lute/envlute/lib/python3.12/site-packages/flask_wtf/form.py", line 55, in wrap_formdata
    if request.files:
       ^^^^^^^^^^^^^
  File "/home/keke/lute/envlute/lib/python3.12/site-packages/werkzeug/utils.py", line 107, in __get__
    value = self.fget(obj)  # type: ignore
            ^^^^^^^^^^^^^^
  File "/home/keke/lute/envlute/lib/python3.12/site-packages/werkzeug/wrappers/request.py", line 494, in files
    self._load_form_data()
  File "/home/keke/lute/envlute/lib/python3.12/site-packages/flask/wrappers.py", line 115, in _load_form_data
    super()._load_form_data()
  File "/home/keke/lute/envlute/lib/python3.12/site-packages/werkzeug/wrappers/request.py", line 268, in _load_form_data
    data = parser.parse(
           ^^^^^^^^^^^^^
  File "/home/keke/lute/envlute/lib/python3.12/site-packages/werkzeug/formparser.py", line 242, in parse
    return parse_func(stream, mimetype, content_length, options)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/keke/lute/envlute/lib/python3.12/site-packages/werkzeug/formparser.py", line 267, in _parse_multipart
    form, files = parser.parse(stream, boundary, content_length)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/keke/lute/envlute/lib/python3.12/site-packages/werkzeug/formparser.py", line 384, in parse
    _write(event.data)
  File "/usr/lib/python3.12/tempfile.py", line 846, in write
    rv = file.write(s)
         ^^^^^^^^^^^^^
OSError: [Errno 28] No space left on device
jzohrab commented 6 months ago

Hm do you have a lot of audio? And this doesn’t occur with chrome? Perhaps FF handles the upload differently.

kekeqwq commented 6 months ago

Hm do you have a lot of audio? And this doesn’t occur with chrome? Perhaps FF handles the upload differently.

12.10hours audiobook chrome not work too sometimes chrome can update 167mb file(not 100%)

jzohrab commented 6 months ago

Right, that’s a very large file to upload :-) so the machine doesn’t like it. I’ll see if I can come up with a hacky method to “side load” the audio file, avoiding the upload issue.

actually, this may cause problems at reading time too, due to how the file is loaded. You might need to split up the audio file somehow.

kekeqwq commented 6 months ago

Right, that’s a very large file to upload :-) so the machine doesn’t like it. I’ll see if I can come up with a hacky method to “side load” the audio file, avoiding the upload issue.

actually, this may cause problems at reading time too, due to how the file is loaded. You might need to split up the audio file somehow.

It might be possible to specify the path directly. If split, re-upload part of the audio each time based on reading progress?

jzohrab commented 6 months ago

If split, re-upload part of the audio each time based on reading progress?

yes, that is what I would do.

kekeqwq commented 6 months ago

If split, re-upload part of the audio each time based on reading progress?

yes, that is what I would do.

good idea! thank u