Page 1 of 2

unpack failing, leading to postprocessing error and restart - guessit - ValueError: unused keyword argument 'children'

Posted: September 24th, 2021, 3:22 am
by blakeo
Unpacking is failing for two or three days now, did not change anything on purpose :)

pb -> 29wF5XxP < sabnzbd.error.log only
pb -> J3cYqRbF < full log

thank you (can't post links as new user)!

Re: unpack failing, leading to postprocessing error and restart - guessit - ValueError: unused keyword argument 'childre

Posted: September 24th, 2021, 4:00 am
by sander
So URLs are:
https://pastebin.com/29wF5XxP
https://pastebin.com/J3cYqRbF

Good bug report.

I cannot reproduce on my SAB 3.4.1 with the same download. But I probably have different category parameters (if any at all).

Your traceback:

Code: Select all

  File "/usr/share/sabnzbdplus/sabnzbd/sorting.py", line 360, in match
    self.guess = guess_what(self.original_job_name, sort_type="episode")
  File "/usr/share/sabnzbdplus/sabnzbd/sorting.py", line 590, in guess_what
    guess = guessit.api.guessit(digit_fix + name, options=guessit_options)
  File "/usr/lib/python3/dist-packages/guessit/api.py", line 71, in guessit
    return default_api.guessit(string, options)
  File "/usr/lib/python3/dist-packages/guessit/api.py", line 222, in guessit
    raise GuessitException(string, options)
guessit.api.GuessitException: An internal error has occured in guessit.
===================== Guessit Exception Report =====================
version=3.1.0
string=La.Gazzetta.Dello.Sport.09.24.2021.iTALiAN.RETAiL.eBook-DiVER-xpost
options={'expected_title': [], 'excludes': ['part'], 'type': 'episode'}
--------------------------------------------------------------------

So I tried by hand, but no traceback either:

Code: Select all

>>> import guessit

>>> guessit.api.guessit("blabla hello 123", options=None)
MatchesDict([('title', 'blabla hello'), ('season', 1), ('episode', 23), ('type', 'episode')])

>>> string = "La.Gazzetta.Dello.Sport.09.24.2021.iTALiAN.RETAiL.eBook-DiVER-xpost"
>>> options={'expected_title': [], 'excludes': ['part'], 'type': 'episode'}
>>> guessit.api.guessit(string, options)
MatchesDict([('title', 'La Gazzetta Dello Sport'), ('date', datetime.date(2021, 9, 24)), ('language', <Language [it]>), ('other', ['Retail', 'Repost']), ('release_group', 'eBook-DiVER'), ('type', 'episode')])
>>>
No Traceback here either. So my method is not correct, or you have different parameters as input?

I could create a SABnzbd with more debugging so that we can find your exact parameters. Are willing & able to use that?

Re: unpack failing, leading to postprocessing error and restart - guessit - ValueError: unused keyword argument 'childre

Posted: September 24th, 2021, 8:40 am
by blakeo
thank you for the fast response!

I should have mentioned that it happens with every file I try to download/unpack, I just chose this one for testing purposes as it is quite small (~15 MB) :)

Everything worked as always until two days ago, the installation is running for a few years now - just regular updates via apt.

I am willing to help, as of able - I hope, not an expert but it shouldn't be a problem with guidance :)

Re: unpack failing, leading to postprocessing error and restart - guessit - ValueError: unused keyword argument 'childre

Posted: September 24th, 2021, 9:48 am
by sander
I created a SAB with 2 extra lines of logging: Go to https://github.com/sanderjo/sabnzbd/act ... 1270241040 and scroll down and find "Source distribution" (you need a github account for this).

Download it, unpack in some temp directory, and run it.
Do a few downloads. I assume you get the tracebacks again.
Go to sabnzbd.log. You should see lines with "SUPERLOG"

Code: Select all

2021-09-24 16:37:32,608::DEBUG::[sorting:590] SUPERLOG: digit_fix  resp name La.Gazzetta.Dello.Sport.09.24.2021.iTALiAN.RETAiL.eBook-DiVER-xpost resp guessit_options {'expected_title': [], 'excludes': ['part'], 'type': 'episode'}
2021-09-24 16:37:32,679::DEBUG::[sorting:592] Initial guess for La.Gazzetta.Dello.Sport.09.24.2021.iTALiAN.RETAiL.eBook-DiVER-xpost is MatchesDict([('title', 'La Gazzetta Dello Sport'), ('date', datetime.date(2021, 9, 24)), ('language', <Language [it]>), ('other', ['Retail', 'Repost']), ('release_group', 'eBook-DiVER'), ('type', 'episode')])
2021-09-24 16:37:32,679::DEBUG::[sorting:593] SUPERLOG: OK
Post the full sabnzbd.log on pb.

Looking at the code, I'm not sure we'll find the cause, but let's try

Re: unpack failing, leading to postprocessing error and restart - guessit - ValueError: unused keyword argument 'childre

Posted: September 24th, 2021, 10:32 am
by sander
oh, wait, easier first step:

Can you do the 5 manual steps I did in the pyton interpreter in viewtopic.php?p=125803#p125803 on your own Linux?

It might a issue with your Linux/Python setup

Re: unpack failing, leading to postprocessing error and restart - guessit - ValueError: unused keyword argument 'childre

Posted: September 24th, 2021, 4:17 pm
by dvanders
I have the same issue, after my focal box upgraded to the latest release a couple days ago.

Here's the reproducer with guessit directly: pastebin dot com q4GvbkM2

Re: unpack failing, leading to postprocessing error and restart - guessit - ValueError: unused keyword argument 'childre

Posted: September 24th, 2021, 4:38 pm
by dvanders
Fixed my server. From this similar issue below I realized that guessit doesn't work with some python3-regex lib, so I did `pip3 uninstall regex` and now guessit and sab work again.

"Stacktrace from startup in rebulk / regex · Issue #748 · morpheus65535/bazarr · GitHub"

Re: unpack failing, leading to postprocessing error and restart - guessit - ValueError: unused keyword argument 'childre

Posted: September 25th, 2021, 6:58 am
by safihre
Indeed that's what we also found out.
We will try to fix this in the next release by overriding this special setting of guessit when it is found.

Re: unpack failing, leading to postprocessing error and restart - guessit - ValueError: unused keyword argument 'childre

Posted: September 26th, 2021, 7:22 am
by oggie
so I'm now getting this same error after upgrading. However, doing a pip3 uninstall regex doesn't fix the issue.

Is there a setting a can use to fix this, or do I have to revert to an older version of sab?

Re: unpack failing, leading to postprocessing error and restart - guessit - ValueError: unused keyword argument 'childre

Posted: September 26th, 2021, 2:19 pm
by sander
Can your run the python3 below, and post the output?

Code: Select all

import guessit
print(guessit.api.guessit("blabla hello 123", options=None))
string = "La.Gazzetta.Dello.Sport.09.24.2021.iTALiAN.RETAiL.eBook-DiVER-xpost"
options={'expected_title': [], 'excludes': ['part'], 'type': 'episode'}
print(guessit.api.guessit(string, options))
Output on my Ubuntu:

Code: Select all

$ python3 test_guessit.py
MatchesDict([('title', 'blabla hello'), ('season', 1), ('episode', 23), ('type', 'episode')])
MatchesDict([('title', 'La Gazzetta Dello Sport'), ('date', datetime.date(2021, 9, 24)), ('language', <Language [it]>), ('other', ['Retail', 'Repost']), ('release_group', 'eBook-DiVER'), ('type', 'episode')])

Re: unpack failing, leading to postprocessing error and restart - guessit - ValueError: unused keyword argument 'childre

Posted: September 26th, 2021, 5:13 pm
by oggie
Well, I reverted back to 3.0 since it continues to work. I will attempt to upgrade, test, and revert back

Re: unpack failing, leading to postprocessing error and restart - guessit - ValueError: unused keyword argument 'childre

Posted: September 26th, 2021, 6:08 pm
by oggie
Ok. I installed 3.4.1 and ran what you posted:

Code: Select all

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/guessit/api.py", line 192, in guessit
    config = self.configure(options, sanitize_options=False)
  File "/usr/lib/python3/dist-packages/guessit/api.py", line 163, in configure
    self.rebulk = rules_builder(advanced_config)
  File "/usr/lib/python3/dist-packages/guessit/rules/__init__.py", line 56, in rebulk_builder
    rebulk.rebulk(episodes(_config('episodes')))
  File "/usr/lib/python3/dist-packages/guessit/rules/properties/episodes.py", line 168, in episodes
    rebulk.chain(
  File "/usr/lib/python3/dist-packages/rebulk/builder.py", line 179, in regex
    return self.pattern(self.build_re(*pattern, **kwargs))
  File "/usr/lib/python3/dist-packages/rebulk/builder.py", line 107, in build_re
    return RePattern(*pattern, **kwargs)
  File "/usr/lib/python3/dist-packages/rebulk/pattern.py", line 441, in __init__
    pattern = call(re.compile, pattern, **self._kwargs)
  File "/usr/lib/python3/dist-packages/rebulk/loose.py", line 60, in call
    return function(*call_args, **call_kwargs)
  File "/usr/local/lib/python3.8/dist-packages/regex/regex.py", line 351, in compile
    return _compile(pattern, flags, ignore_unused, kwargs, _cache_all)
  File "/usr/local/lib/python3.8/dist-packages/regex/regex.py", line 602, in _compile
    raise ValueError('unused keyword argument {!a}'.format(any_one))
ValueError: unused keyword argument 'private_names'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "sab.py", line 2, in <module>
    print(guessit.api.guessit("blabla hello 123", options=None))
  File "/usr/lib/python3/dist-packages/guessit/api.py", line 71, in guessit
    return default_api.guessit(string, options)
  File "/usr/lib/python3/dist-packages/guessit/api.py", line 222, in guessit
    raise GuessitException(string, options)
guessit.api.GuessitException: An internal error has occured in guessit.
===================== Guessit Exception Report =====================
version=3.1.0
string=blabla hello 123
options={}
--------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/guessit/api.py", line 192, in guessit
    config = self.configure(options, sanitize_options=False)
  File "/usr/lib/python3/dist-packages/guessit/api.py", line 163, in configure
    self.rebulk = rules_builder(advanced_config)
  File "/usr/lib/python3/dist-packages/guessit/rules/__init__.py", line 56, in rebulk_builder
    rebulk.rebulk(episodes(_config('episodes')))
  File "/usr/lib/python3/dist-packages/guessit/rules/properties/episodes.py", line 168, in episodes
    rebulk.chain(
  File "/usr/lib/python3/dist-packages/rebulk/builder.py", line 179, in regex
    return self.pattern(self.build_re(*pattern, **kwargs))
  File "/usr/lib/python3/dist-packages/rebulk/builder.py", line 107, in build_re
    return RePattern(*pattern, **kwargs)
  File "/usr/lib/python3/dist-packages/rebulk/pattern.py", line 441, in __init__
    pattern = call(re.compile, pattern, **self._kwargs)
  File "/usr/lib/python3/dist-packages/rebulk/loose.py", line 60, in call
    return function(*call_args, **call_kwargs)
  File "/usr/local/lib/python3.8/dist-packages/regex/regex.py", line 351, in compile
    return _compile(pattern, flags, ignore_unused, kwargs, _cache_all)
  File "/usr/local/lib/python3.8/dist-packages/regex/regex.py", line 602, in _compile
    raise ValueError('unused keyword argument {!a}'.format(any_one))
ValueError: unused keyword argument 'private_names'
--------------------------------------------------------------------
Please report at https://github.com/guessit-io/guessit/issues.
====================================================================

Re: unpack failing, leading to postprocessing error and restart - guessit - ValueError: unused keyword argument 'childre

Posted: September 26th, 2021, 6:10 pm
by oggie
I then did a
pip3 uninstall regex
since it was suggested above, and got this result:

Code: Select all

Traceback (most recent call last):
  File "sab.py", line 1, in <module>
    import guessit
  File "/usr/lib/python3/dist-packages/guessit/__init__.py", line 8, in <module>
    from .api import guessit, GuessItApi
  File "/usr/lib/python3/dist-packages/guessit/api.py", line 20, in <module>
    from .rules import rebulk_builder
  File "/usr/lib/python3/dist-packages/guessit/rules/__init__.py", line 11, in <module>
    from .properties.episodes import episodes
  File "/usr/lib/python3/dist-packages/guessit/rules/properties/episodes.py", line 15, in <module>
    from guessit.rules.common.numeral import parse_numeral, numeral
  File "/usr/lib/python3/dist-packages/guessit/rules/common/numeral.py", line 71, in <module>
    __romanNumeralPattern = re.compile('^' + roman_numeral + '$')
AttributeError: module 'regex' has no attribute 'compile'

Re: unpack failing, leading to postprocessing error and restart - guessit - ValueError: unused keyword argument 'childre

Posted: September 27th, 2021, 1:44 am
by sander
So even with that small, plain python program (where no SAB code is involved) you get errors. Then it is a OS and/or python library setup thing. I'm not good at helping with that. Hopefully others are.

For google reference, your error message (which should not occur):

Code: Select all

AttributeError: module 'regex' has no attribute 'compile'
EDIT

Maybe this is relevant: https://stackoverflow.com/questions/663 ... 6_66418957

So ... what is the result of this command on your system:

Code: Select all

locate regex.py
It yields nothing on my system, so that is good apparantly.

I do have a regex module:

Code: Select all

>>> import regex
>>> regex.__file__
'/home/sander/.local/lib/python3.8/site-packages/regex/__init__.py'
>>>
So that is OK.

... the above is why I said " I'm not good at helping with that." ... to me, it's trial-and-error.

Re: unpack failing, leading to postprocessing error and restart - guessit - ValueError: unused keyword argument 'childre

Posted: September 27th, 2021, 3:55 am
by blakeo
ok, that did it for me - pip3 uninstall regex was succesful but locate regex.py still found a package - I deleted the folder and now your command as well as sab work fine again - thank you :)