NZB TypeError: sequence item 0: expected str instance, NoneType found

Post any problems / bugs / issues that are Mylar-related in here.
Post Reply
chcme
Posts: 5
Joined: Thu Jun 22, 2023 9:28 pm

NZB TypeError: sequence item 0: expected str instance, NoneType found

Post by chcme »

When Mylar searcher finds a hit with an nzb, it runs into the following error (below). This started occurring after I was running into the nzb fetch issue so I updated the config.ini return_host value per prior topics on the same issue.

I validated SABnzbd config and the newznab tested correctly in Myla.
Connection to SABnzbd tested sucessfully
Successfully tested NZBGeek - valid api response received

Code: Select all

Traceback (most recent call last):
File "C:\ProgramData\Mylar\mylar\search.py", line 2496, in searchforissue
foundNZB, prov = search_init(
File "C:\ProgramData\Mylar\mylar\search.py", line 538, in search_init
findit = search_the_matrix(scarios)
File "C:\ProgramData\Mylar\mylar\search.py", line 4209, in search_the_matrix
return NZB_SEARCH(
File "C:\ProgramData\Mylar\mylar\search.py", line 1392, in NZB_SEARCH
verification(verified_matches, is_info)
File "C:\ProgramData\Mylar\mylar\search.py", line 1442, in verification
searchresult = searcher(
File "C:\ProgramData\Mylar\mylar\search.py", line 3634, in searcher
sendtosab = ss.sender()
File "C:\ProgramData\Mylar\mylar\sabnzbd.py", line 67, in sender
'nzo_id': ''.join(sendresponse['nzo_ids']),
TypeError: sequence item 0: expected str instance, NoneType found
Traceback (most recent call last):
File "C:\ProgramData\Mylar\mylar\search.py", line 2496, in searchforissue
foundNZB, prov = search_init(
File "C:\ProgramData\Mylar\mylar\search.py", line 538, in search_init
findit = search_the_matrix(scarios)
File "C:\ProgramData\Mylar\mylar\search.py", line 4209, in search_the_matrix
return NZB_SEARCH(
File "C:\ProgramData\Mylar\mylar\search.py", line 1392, in NZB_SEARCH
verification(verified_matches, is_info)
File "C:\ProgramData\Mylar\mylar\search.py", line 1442, in verification
searchresult = searcher(
File "C:\ProgramData\Mylar\mylar\search.py", line 3634, in searcher
sendtosab = ss.sender()
File "C:\ProgramData\Mylar\mylar\sabnzbd.py", line 67, in sender
'nzo_id': ''.join(sendresponse['nzo_ids']),
TypeError: sequence item 0: expected str instance, NoneType found
User avatar
evilhero
Site Admin
Posts: 2887
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: NZB TypeError: sequence item 0: expected str instance, NoneType found

Post by evilhero »

The error means that it's getting a null response back from your sab instance when it tries to request the history.

It could be one of 2 things possibly;
- your return_host value in the config.ini isn't set properly
- the sab url you provided is not accessible for some reason (perhaps you added an endpoint to the url)
chcme
Posts: 5
Joined: Thu Jun 22, 2023 9:28 pm

Re: NZB TypeError: sequence item 0: expected str instance, NoneType found

Post by chcme »

thanks for the quick reply.

When I run Test SABnzbd it replies successful so I have to assume the sab url is correct.

Config.ini:
[Interface]
http_port = 8090
http_host = 0.0.0.0
http_username = None
http_password = None
http_root = /
enable_https = False
https_cert = None
https_key = None
https_chain = None
https_force_on = False
host_return = 192.168.1.92
authentication = 0
login_timeout = 43800
alphaindex = True
cherrypy_logging = False


192.168.1.92 is the local machine, which both SAB and Mylar are running on.
chcme
Posts: 5
Joined: Thu Jun 22, 2023 9:28 pm

Re: NZB TypeError: sequence item 0: expected str instance, NoneType found

Post by chcme »

SABnzbd config

Code: Select all

[SABnzbd]
sab_host = http://127.0.0.1:8095
sab_username = [removed]
sab_password = [removed]
sab_apikey = [removed]
sab_category = comics
sab_priority = Default
sab_to_mylar = False
sab_directory = None
sab_version = 4.0.2
	
sab_moving_delay = 5
sab_client_post_processing = True
Last edited by chcme on Fri Jun 23, 2023 1:36 am, edited 1 time in total.
chcme
Posts: 5
Joined: Thu Jun 22, 2023 9:28 pm

Re: NZB TypeError: sequence item 0: expected str instance, NoneType found

Post by chcme »

This is an example of just one, but it happens for all nzbs it tries to send. I also uninstalled SABnzbd and reinstalled with same issue, although I did keep the config settings file to save time.

I hardcoded the api call (below) into my browser and got the following output: {"status":true,"nzo_ids":[null]}

Code: Select all

http://127.0.0.1:8095/api?mode=addurl&name=192.168.1.92/api?apikey=xxMylarGeneratedkeyxx&cmd=downloadNZB&nzbname=Howard.The.Duck.006.1976.Digital.TLK-EMPIRE-HD.nzb&cmd=downloadNZB&nzbname=Howard.The.Duck.006.1976.Digital.TLK-EMPIRE-HD.nzb&output=json&priority=-100&cat=comics&apikey=xxmyAPIkeyxx
User avatar
evilhero
Site Admin
Posts: 2887
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: NZB TypeError: sequence item 0: expected str instance, NoneType found

Post by evilhero »

host_return has to be in the format of protocol://ip:port (basically what you would put in a web browser to hit your mylar instance). Putting it in any other format will result in the error you are receiving atm.
chcme
Posts: 5
Joined: Thu Jun 22, 2023 9:28 pm

Re: NZB TypeError: sequence item 0: expected str instance, NoneType found

Post by chcme »

I seemed to have fixed it. Had to change config.ini for host_return = None
User avatar
evilhero
Site Admin
Posts: 2887
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: NZB TypeError: sequence item 0: expected str instance, NoneType found

Post by evilhero »

Yeah you only would have to use host_return if the local ip cannot be resolved (usually docker installs have problems related to this), or you're running a multi-homed ip.

For typical metal installs, you shouldn't need to set it at all.

Glad you got it working!
Post Reply