jarun / buku

:bookmark: Personal mini-web in text
GNU General Public License v3.0
6.52k stars 294 forks source link

after upgrade from 4.7 to 4.8 bukuserver can't add a new bookmark - internal server error #712

Closed dkebler closed 9 months ago

dkebler commented 9 months ago

I upgraded from 4.7 to 4.8 and now the bukuserver throws an internal server error. I know I am supposed to install from github but b4 I do that maybe there is some issue in the upgrade (like the sqlite db needs to be upgraded?)

The rest of web ui is fine. I can access all records just can't add a new one (using bookmarklet)

here is the debug log when I click the bookmarklet. It doesn't matter what page I am visiting

Jan 27 11:16:48 trantor bash[516698]: 10.0.0.2 - - [27/Jan/2024 11:16:48] "GET /bookmarklet?url=https%3A%2F%2Fgithub.com%2Fjarun%2Fbuku%2Fissues%2F565&title=500%20Internal%20Server%20Error%20upon%20loading%20an%20extra%20page%20·%20Issue%20%23565%20·%20jarun%2Fbuku&description=--debugger%20%3E%20bukuserver2.log HTTP/1.1" 302 -
Jan 27 11:16:48 trantor bash[516698]: [2024-01-27 11:16:48,035] ERROR in app: Exception on /bookmark/new/ [GET]
Jan 27 11:16:48 trantor bash[516698]: Traceback (most recent call last):
Jan 27 11:16:48 trantor bash[516698]:   File "/opt/python/apps/venvs/buku/lib/python3.8/site-packages/flask_admin/base.py", line 369, in _run_view
Jan 27 11:16:48 trantor bash[516698]:     return fn(self, *args, **kwargs)
Jan 27 11:16:48 trantor bash[516698]:   File "/opt/python/apps/venvs/buku/lib/python3.8/site-packages/flask_admin/model/base.py", line 2093, in create_view
Jan 27 11:16:48 trantor bash[516698]:     form = self.create_form()
Jan 27 11:16:48 trantor bash[516698]:   File "/opt/python/apps/venvs/buku/lib/python3.8/site-packages/bukuserver/views.py", line 190, in create_form
Jan 27 11:16:48 trantor bash[516698]:     form = super().create_form(obj)
Jan 27 11:16:48 trantor bash[516698]:   File "/opt/python/apps/venvs/buku/lib/python3.8/site-packages/flask_admin/model/base.py", line 1332, in create_form
Jan 27 11:16:48 trantor bash[516698]:     return self._create_form_class(get_form_data(), obj=obj)
Jan 27 11:16:48 trantor bash[516698]:   File "/opt/python/apps/venvs/buku/lib/python3.8/site-packages/wtforms/form.py", line 208, in __call__
Jan 27 11:16:48 trantor bash[516698]:     return type.__call__(cls, *args, **kwargs)
Jan 27 11:16:48 trantor bash[516698]:   File "/opt/python/apps/venvs/buku/lib/python3.8/site-packages/flask_wtf/form.py", line 73, in __init__
Jan 27 11:16:48 trantor bash[516698]:     super().__init__(formdata=formdata, **kwargs)
Jan 27 11:16:48 trantor bash[516698]:   File "/opt/python/apps/venvs/buku/lib/python3.8/site-packages/wtforms/form.py", line 268, in __init__
Jan 27 11:16:48 trantor bash[516698]:     super(Form, self).__init__(self._unbound_fields, meta=meta_obj, prefix=prefix)
Jan 27 11:16:48 trantor bash[516698]:   File "/opt/python/apps/venvs/buku/lib/python3.8/site-packages/wtforms/form.py", line 51, in __init__
Jan 27 11:16:48 trantor bash[516698]:     field = meta.bind_field(self, unbound_field, options)
Jan 27 11:16:48 trantor bash[516698]:   File "/opt/python/apps/venvs/buku/lib/python3.8/site-packages/wtforms/meta.py", line 27, in bind_field
Jan 27 11:16:48 trantor bash[516698]:     return unbound_field.bind(form=form, **options)
Jan 27 11:16:48 trantor bash[516698]:   File "/opt/python/apps/venvs/buku/lib/python3.8/site-packages/wtforms/fields/core.py", line 376, in bind
Jan 27 11:16:48 trantor bash[516698]:     return self.field_class(*self.args, **kw)
Jan 27 11:16:48 trantor bash[516698]: TypeError: __init__() got an unexpected keyword argument 'name'
Jan 27 11:16:48 trantor bash[516698]: During handling of the above exception, another exception occurred:
Jan 27 11:16:48 trantor bash[516698]: Traceback (most recent call last):
Jan 27 11:16:48 trantor bash[516698]:   File "/opt/python/apps/venvs/buku/lib/python3.8/site-packages/flask/app.py", line 2525, in wsgi_app
Jan 27 11:16:48 trantor bash[516698]:     response = self.full_dispatch_request()
Jan 27 11:16:48 trantor bash[516698]:   File "/opt/python/apps/venvs/buku/lib/python3.8/site-packages/flask/app.py", line 1822, in full_dispatch_request
Jan 27 11:16:48 trantor bash[516698]:     rv = self.handle_user_exception(e)
Jan 27 11:16:48 trantor bash[516698]:   File "/opt/python/apps/venvs/buku/lib/python3.8/site-packages/flask_api/app.py", line 106, in handle_user_exception
Jan 27 11:16:48 trantor bash[516698]:     raise e
Jan 27 11:16:48 trantor bash[516698]:   File "/opt/python/apps/venvs/buku/lib/python3.8/site-packages/flask/app.py", line 1820, in full_dispatch_request
Jan 27 11:16:48 trantor bash[516698]:     rv = self.dispatch_request()
Jan 27 11:16:48 trantor bash[516698]:   File "/opt/python/apps/venvs/buku/lib/python3.8/site-packages/flask/app.py", line 1796, in dispatch_request
Jan 27 11:16:48 trantor bash[516698]:     return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
Jan 27 11:16:48 trantor bash[516698]:   File "/opt/python/apps/venvs/buku/lib/python3.8/site-packages/flask_admin/base.py", line 69, in inner
Jan 27 11:16:48 trantor bash[516698]:     return self._run_view(f, *args, **kwargs)
Jan 27 11:16:48 trantor bash[516698]:   File "/opt/python/apps/venvs/buku/lib/python3.8/site-packages/flask_admin/base.py", line 371, in _run_view
Jan 27 11:16:48 trantor bash[516698]:     return fn(cls=self, **kwargs)
Jan 27 11:16:48 trantor bash[516698]: TypeError: create_view() got an unexpected keyword argument 'cls'
Jan 27 11:16:48 trantor bash[516698]: 10.0.0.2 - - [27/Jan/2024 11:16:48] "GET /bookmark/new/?link=https%3A%2F%2Fgithub.com%2Fjarun%2Fbuku%2Fissues%2F565&title=500+Internal+Server+Error+upon+loading+an+extra+page+·+Issue+%23565+·+jarun%2Fbuku&description=--debugger+%3E+bukuserver2.log HTTP/1.1" 500 -
dkebler commented 9 months ago

javascript:void function(){var e=location.href,t=document.title.trim()||"",o=document.getSelection().toString().trim()||(document.querySelector("meta[name$=description i], meta[property$=description i]")||{}).content||"";o.length>4e3%26%26(o=o.substr(0,4e3)+"...",alert("The selected text is too long, it will be truncated.")),e="http://bookmarks.hacking.xxxxx.net/bookmarklet%3Furl="+encodeURIComponent(e)+"%26title="+encodeURIComponent(t)+"%26description="+encodeURIComponent(o),window.open(e,"_blank","menubar=no, height=600, width=600, toolbar=no, scrollbars=yes, status=no, dialog=1")}();

that's the bookmarklet code. I am using Chromium Version 120.0.6099.224 (Official Build) Arch Linux (64-bit)

dkebler commented 9 months ago

javascript:void function(){var e=location.href,t=document.title.trim()||"",o=document.getSelection().toString().trim()||(document.querySelector("meta[name$=description i], meta[property$=description i]")||{}).content||"";o.length>4e3%26%26(o=o.substr(0,4e3)+"...",alert("The selected text is too long, it will be truncated.")),e="http://bookmarks.hacking.kebler.net/bookmarklet%3Furl="+encodeURIComponent(e)+"%26title="+encodeURIComponent(t)+"%26description="+encodeURIComponent(o),window.open(e,"_blank","menubar=no, height=600, width=600, toolbar=no, scrollbars=yes, status=no, dialog=1")}();

the bookmarklet code. I am using Chromium Version 120.0.6099.224 (Official Build) Arch Linux (64-bit)

dkebler commented 9 months ago

not a problem to add a record from buku command line so issue is with server/bookmarklet.

dkebler commented 9 months ago

I installed bukuserver direct from git last commit and the issue is resolved.

Time to make a release :).

Closing this.