nzbgetcom / nzbget

Efficient usenet downloader
https://nzbget.com
GNU General Public License v2.0
342 stars 16 forks source link

Cannot test news server connection #250

Closed AnonymousRetard closed 6 months ago

AnonymousRetard commented 6 months ago

Is there already an issue for your problem?

NZBGet Version

v23-stable

Platform

NAS/Synology/QNAP

Environment

Device: Synology DS1019+
OS: DSM 7.2.1-69057 Update 4
Running in docker: no

Current Behavior

Whenever I click "Test connection" on any of my news servers I get the following error message in red at the top:

Error in http://nzbget.secure/combined.js?lib/jquery.min.js+lib/bootstrap.min.js+lib/raphael.min.js+lib/elycharts.min.js+fasttable.js+index.js+util.js+downloads.js+edit.js+status.js+messages.js+history.js+upload.js+config.js+feed.js (line 12006) Uncaught TypeError: Cannot read properties of null (reading 'formId')

and nothing happens. The message box saying "Testing connection..." remains on screen forever until page is refreshed.

Expected Behavior

The news server connection gets tested.

Steps To Reproduce

  1. Click "Test connection" on any defined news server

Logs

No response

Extra information

I looked at the offending line of code and it looks like it's trying to find a setting whether I want to verify certificates or not for this particular server but there is no such form element available per server. var certVerifLevel = getCertVerifLevel(getOptionValue(findOptionByName('Server' + multiid + '.CertVerification')));

Such a form element doesn't exist. The only one I can find is a general one under "Security" called "CertCheck", which I do have enabled.

AnonymousRetard commented 6 months ago

I can add that I updated to 24.0-testing-20240426 today and the issue remains. I have also searched for other tickets regarding this and not found anything. I've had this issue for a long time but have not reported it until now.

dnzbk commented 6 months ago

I managed to reproduce the error only after manually removing Server1.CertVerification=strict from nzbget.conf.template. Apparently nzbget.conf.template was corrupted somehow. Please try reinstalling the package. Don't forget to backup the config in SETTINGS->SYSTEM->Backup Settings. Btw, what kind of package are you using: SynoCommunity or SPK?

AnonymousRetard commented 6 months ago

Thanks for your quick response! The package was originally installed using the DSM package center from SynoCommunity but unfortunately I don't remember everything I did. If I remember correctly I somehow got information of the migration to this new repository and that updates would no longer be installed through package center but through the in-app updater instead.

I don't remember if I originally installed nzbget to a Drobo which is now dead or if I was running it on my Gentoo server but at some point I migrated the install to Synology by installing it through the package center in DSM and probably just importing a backup of my configuration.

My config-file seems to be located at /volume2/\@appdata/nzbget/nzbget.conf and it contains this line: ConfigTemplate=/volume2/@appstore/nzbget/share/nzbget/nzbget.conf

This file does not contain any Server1.CertVerification=strict line.

The app itself seems to be installed at "/volume2/@appstore/nzbget" and it contains two identical nzbget.conf files: Alex@DS1019:/volume2/@appstore/nzbget$ find ./ -iname nzbget.conf ./share/nzbget/nzbget.conf ./bin/nzbget.conf

Those are quite old, with a modification date of 18 January. If I instead search for "nzbget.conf.template" I see it is now located at: ./bin/webui/nzbget.conf.template

Therefore I now manually edited the nzbget.conf file to say this instead: ConfigTemplate=/volume2/@appstore/nzbget/bin/webui/nzbget.conf.template

Then I went to "System" in nzbget and clicked the "Reload" button, now "ServerX.CertVerification" options are showing up (with a little "New" icon) and I can once again click the "Test connection" button.

This was originally working on my Synology and I think it broke the moment I installed the new release without using the DSM package center.

If the old file I was appearantly using as a config template is of any interest I have uploaded it below. nzbget.zip

So, not entirely sure how I ended up in this situation but it seems like you found the root cause and that the issue is now resolved. Thanks!