Project

General

Profile

Bug #37806

Create SabNZBD iocage plugin

Added by Dru Lavigne over 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
No priority
Assignee:
Martin Wilke
Category:
Plugins
Target version:
Seen in:
Severity:
New
Reason for Closing:
Reason for Blocked:
Needs QA:
Yes
Needs Doc:
Yes
Needs Merging:
Yes
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

This one is needed for feature parity with legacy plugins.


Related issues

Related to FreeNAS - Umbrella #32442: Port remaining warden plugins to iocageClosed
Related to FreeNAS - Feature #39573: Update iocage Plugins for BETA3Done
Related to FreeNAS - Feature #44856: Update iocage Plugins for RC1Done
Has duplicate FreeNAS - Bug #40416: SABNZBD and SONARR plugin installation issues on 11.2 Beta2Closed

History

#1 Updated by Dru Lavigne over 2 years ago

  • Related to Umbrella #32442: Port remaining warden plugins to iocage added

#2 Updated by Martin Wilke over 2 years ago

@dru just to double check is this here http://freshports.org/news/sabnzbdplus the same?

#3 Updated by Dru Lavigne over 2 years ago

Yes.

#4 Updated by Dru Lavigne over 2 years ago

Master PR for initial work: https://github.com/freenas/iocage-ix-plugins/pull/33 (plugin not complete yet)

#5 Updated by Dru Lavigne over 2 years ago

  • Status changed from Unscreened to In Progress
  • Target version changed from 11.2-RC2 to 11.2-BETA2

#6 Updated by Dru Lavigne over 2 years ago

  • Status changed from In Progress to Not Started
  • Target version changed from 11.2-BETA2 to 11.2-BETA3

#9 Updated by Dru Lavigne about 2 years ago

  • Has duplicate Bug #40416: SABNZBD and SONARR plugin installation issues on 11.2 Beta2 added

#10 Updated by Disk Didler about 2 years ago

"unexpected http response 401 for https://github.com/freenas/iocage-plugin-sabnzbd/info/refs?service=git-upload-pack"

Can confirm, not working as of the 19'th on 11.2 Beta2?

#11 Updated by Dru Lavigne about 2 years ago

  • Target version changed from 11.2-BETA3 to 11.2-RC1

#12 Updated by Bruno Pereira about 2 years ago

  • Seen in changed from 11.2-BETA1 to 11.2-BETA2

Disk Didler wrote:

"unexpected http response 401 for https://github.com/freenas/iocage-plugin-sabnzbd/info/refs?service=git-upload-pack"

Can confirm, not working as of the 19'th on 11.2 Beta2?

I can confirm the issue in 11.2 Beta2, downloaded the iso and installed today:


Error: concurrent.futures.process._RemoteTraceback: 
""" 
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/dulwich/client.py", line 1261, in _http_request
    resp = self.opener.open(req)
  File "/usr/local/lib/python3.6/urllib/request.py", line 532, in open
    response = meth(req, response)
  File "/usr/local/lib/python3.6/urllib/request.py", line 642, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/lib/python3.6/urllib/request.py", line 570, in error
    return self._call_chain(*args)
  File "/usr/local/lib/python3.6/urllib/request.py", line 504, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.6/urllib/request.py", line 650, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 401: Authorization Required

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/concurrent/futures/process.py", line 175, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
  File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 122, in main_worker
    res = loop.run_until_complete(coro)
  File "/usr/local/lib/python3.6/asyncio/base_events.py", line 468, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 82, in _run
    return await self._call(f'{service_name}.{method}', serviceobj, methodobj, params=args, job=job)
  File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 75, in _call
    return methodobj(*params)
  File "/usr/local/lib/python3.6/site-packages/middlewared/worker.py", line 75, in _call
    return methodobj(*params)
  File "/usr/local/lib/python3.6/site-packages/middlewared/schema.py", line 662, in nf
    return f(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/middlewared/plugins/jail.py", line 248, in fetch
    iocage.fetch(**options)
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/iocage.py", line 909, in fetch
    props, accept_license=accept, official=official)
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_plugin.py", line 690, in fetch_plugin_index
    props, 0, accept_license)
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_plugin.py", line 128, in fetch_plugin
    self.__fetch_plugin_post_install__(conf, _conf, jaildir, jail_name)
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_plugin.py", line 515, in __fetch_plugin_post_install__
    self.__clone_repo(conf['artifact'], f'{jaildir}/plugin')
  File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_plugin.py", line 1233, in __clone_repo
    remote_refs = client.fetch(repo_url, local)
  File "/usr/local/lib/python3.6/site-packages/dulwich/client.py", line 363, in fetch
    progress)
  File "/usr/local/lib/python3.6/site-packages/dulwich/client.py", line 1398, in fetch_pack
    b"git-upload-pack", url)
  File "/usr/local/lib/python3.6/site-packages/dulwich/client.py", line 1282, in _discover_references
    resp, read = self._http_request(url, headers, allow_compression=True)
  File "/usr/local/lib/python3.6/site-packages/dulwich/client.py", line 1267, in _http_request
    (e.code, url))
dulwich.errors.GitProtocolError: unexpected http response 401 for https://github.com/freenas/iocage-plugin-sabnzbd/info/refs?service=git-upload-pack
""" 

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/middlewared/job.py", line 332, in run
    await self.future
  File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 129, in throw
    return self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.6/site-packages/middlewared/job.py", line 356, in __run_body
    rv = await self.middleware._call_worker(self.serviceobj, self.method_name, *self.args, job={'id': self.id})
  File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 129, in throw
    return self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 977, in _call_worker
    job,
  File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 129, in throw
    return self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 908, in run_in_proc
    return await self.run_in_executor(self.__procpool, method, *args, **kwargs)
  File "/usr/local/lib/python3.6/asyncio/coroutines.py", line 129, in throw
    return self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.6/site-packages/middlewared/main.py", line 902, in run_in_executor
    return await loop.run_in_executor(pool, functools.partial(method, *args, **kwargs))
dulwich.errors.GitProtocolError: unexpected http response 401 for https://github.com/freenas/iocage-plugin-sabnzbd/info/refs?service=git-upload-pack

#13 Updated by freenas forum about 2 years ago

Bruno Pereira wrote:

Disk Didler wrote:

"unexpected http response 401 for https://github.com/freenas/iocage-plugin-sabnzbd/info/refs?service=git-upload-pack"

Can confirm, not working as of the 19'th on 11.2 Beta2?

I can confirm the issue in 11.2 Beta2, downloaded the iso and installed today:

[...]

Similar issue using 11.2 Beta2.
iocage fetch --plugins --name "sabnzbd" ip4_addr="bge0|192.168.7.13"

Plugin: SABnzbd
Official Plugin: True
Using RELEASE: 11.2-RELEASE
Post-install Artifact: https://github.com/freenas/iocage-plugin-sabnzbd
These pkgs will be installed:
- news/sabnzbdplus
Fetching artifact...
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/dulwich/client.py", line 1261, in _http_request
resp = self.opener.open(req)
File "/usr/local/lib/python3.6/urllib/request.py", line 532, in open
response = meth(req, response)
File "/usr/local/lib/python3.6/urllib/request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/local/lib/python3.6/urllib/request.py", line 570, in error
return self._call_chain(*args)
File "/usr/local/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/usr/local/lib/python3.6/urllib/request.py", line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 401: Authorization Required

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/iocage", line 10, in <module>
sys.exit(cli())
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 722, in call
return self.main(args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/local/lib/python3.6/site-packages/iocage/cli/fetch.py", line 136, in cli
ioc.IOCage(exit_on_error=True).fetch(
*kwargs)
File "/usr/local/lib/python3.6/site-packages/iocage/lib/iocage.py", line 909, in fetch
props, accept_license=accept, official=official)
File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_plugin.py", line 690, in fetch_plugin_index
props, 0, accept_license)
File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_plugin.py", line 128, in fetch_plugin
self.
_fetch_plugin_post_install__(conf, conf, jaildir, jail_name)
File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_plugin.py", line 515, in fetch_plugin_post_install
self.
_clone_repo(conf['artifact'], f'{jaildir}/plugin')
File "/usr/local/lib/python3.6/site-packages/iocage/lib/ioc_plugin.py", line 1233, in __clone_repo
remote_refs = client.fetch(repo_url, local)
File "/usr/local/lib/python3.6/site-packages/dulwich/client.py", line 363, in fetch
progress)
File "/usr/local/lib/python3.6/site-packages/dulwich/client.py", line 1398, in fetch_pack
b"git-upload-pack", url)
File "/usr/local/lib/python3.6/site-packages/dulwich/client.py", line 1282, in _discover_references
resp, read = self._http_request(url, headers, allow_compression=True)
File "/usr/local/lib/python3.6/site-packages/dulwich/client.py", line 1267, in _http_request
(e.code, url))
dulwich.errors.GitProtocolError: unexpected http response 401 for https://github.com/freenas/iocage-plugin-sabnzbd/info/refs?service=git-upload-pack

#14 Updated by Disk Didler about 2 years ago

If I'm right, I think we're trying a plugin that's actually barely been started, it actually shouldn't be in the list.

They're changing it so that half complete plugins are not in the list, but right now, they're still listed.
Hopefully they start this one, before B3 in 8 days though.

#15 Updated by freenas forum about 2 years ago

Disk Didler wrote:

If I'm right, I think we're trying a plugin that's actually barely been started, it actually shouldn't be in the list.

They're changing it so that half complete plugins are not in the list, but right now, they're still listed.
Hopefully they start this one, before B3 in 8 days though.

Ahh thanks. That makes sense. If this is all on GIT is there any docs that you know of that we can perhaps pick this up?

The GITLAB plugin worked. Perhaps in the mean time we can update the 'official' flag in the JSON to an informative message. I'm assuming that the raw text from the json is displayed in the plugin list and that this won't impact 11.1.

#16 Updated by Disk Didler about 2 years ago

If you just hold out a few days, you'll find it'll work soon.

#17 Updated by Dru Lavigne about 2 years ago

#18 Updated by Dru Lavigne about 2 years ago

#19 Updated by Disk Didler about 2 years ago

If you'd like a hand with this plugin, I'm trying to learn how to write one in this thread:
https://forums.freenas.org/index.php?threads/creating-and-testing-iocage-plugins.69788/#post-481813

Either way, the reason it's not working dead easily (just install the freshport package) is there's a line called "host" in the ini file, which is pointing to the wrong IP address, if you look at my script, you can see one method of fixing it.

There could be other things, but that's all I had to do, to get it working for me. I hope this helps.
(Regardless, I'll be continuing practicing building a plugin, in that thread with this software)

Thanks

#20 Updated by Disk Didler about 2 years ago

Ok this now works perfectly, but I don't want to be responsible for maintaining it because I'm not smart enough (sorry guys)
Here's the information: https://github.com/jaxjexjox/freenasplugintest

Here's my json file:


{
  "name": "sabnzbdtest",
  "release": "11.1-RELEASE",
  "artifact": "https://github.com/jaxjexjox/freenasplugintest.git",
  "pkgs": [
    "news/sabnzbdplus" 
  ],
  "packagesite": "http://pkg.FreeBSD.org/FreeBSD:11:amd64/quarterly",
  "fingerprints": {
          "iocage-plugins": [
                  {
                  "function": "sha256",
                  "fingerprint": "b0170035af3acc5f3f3ae1859dc717101b4e6c1d0a794ad554928ca0cbb2f438" 
          }
          ]
  },
  "official": false
}

Please feel free to steal / copy all of this if it helps. I'd love to submit it and go through that process, but I don't know what would happen if things break (if I become the owner)
Thanks again. Couldn't have done it without Jurgen.

#21 Updated by Dru Lavigne about 2 years ago

  • Target version changed from 11.2-RC1 to 11.2-RC2

#22 Updated by Dru Lavigne about 2 years ago

  • Target version changed from 11.2-RC2 to Backlog

#23 Updated by Dru Lavigne almost 2 years ago

#24 Updated by Dru Lavigne almost 2 years ago

  • Related to deleted (Feature #53790: Update iocage Plugins for 11.2-RC2)

#25 Updated by Dru Lavigne almost 2 years ago

  • Category changed from OS to Plugins

#26 Updated by Richard Fuller almost 2 years ago

I had to reinstall my server and I'm blocked on SabNZBd being missing. I'd like to help with this if someone can run me through what's required. Martin?

#27 Updated by Disk Didler over 1 year ago

Target version 11.3 or backlog?.......

#28 Updated by Disk Didler over 1 year ago

https://www.freshports.org/news/sabnzbdplus/

Finally 2.3.7 - if we can get this in, will be good.

#29 Updated by Matt B over 1 year ago

Has there been any movement on this? I notice the JSON is still present in the master branch of iocage-ix-plugins but the repository that file points to is still behind an authentication wall. Disk's version looks like it might not be appropriate to install since the INI file in it has some API keys which may not be intentional. I think it's a better option for me to try my own hand at spinning up an iocage plugin for this but I don't want to duplicate work if it's already being worked on by somebody.

#30 Updated by Disk Didler over 1 year ago

I think if you use mine, then just regenerate the key it might be ok?
I can remove the key.

I'm stuck at an older version because I can't be bothered upgrading. (I also use news pretty rarely)
I heard from Dru they seem to be reducing the amount of plugins they will maintain, in the hope the community will maintain some and that seems fine but they're really going to have to encourage people develop them.

I mean don't quote me here but the fact it took me, an amateur to try in my spare time to make this and it /seems/ no one else is bothering is kind of worrying. We need more community involvement and or more community.

Honestly I wish there was some kind of bounty program. I'd pay $1 for every release of my favourite few plugins. Like a patreon for plugin developers, who knows.

They need these plugins to pull in more users, with more users, more potential developers.
Anyhow, feel free to use my version and just nuke the key - although I'm unsure if it still even works :(

#31 Avatar?id=14398&size=24x24 Updated by Kris Moore over 1 year ago

  • Status changed from Not Started to Closed

Also available in: Atom PDF