D-Link Forums

The Graveyard - Products No Longer Supported => D-Link Storage => DNS-323 => Topic started by: irotjaf on June 17, 2010, 05:29:55 PM

Title: Fixed error "Connection to server failed" for BitTorrent (fw 1.08)
Post by: irotjaf on June 17, 2010, 05:29:55 PM
Hi all,

Today an annoying message started to appear on the BitTorrent "DOWNLOADS" list.
"Connection to server failed" (firmware 1.08)

When clicking the "Retry" button I can briefly see the download and upload speeds changing, but the error comes up suddenly after. This makes impossible to use the webpage so BitTorrent is not usable.

I couldn't find any solution around, therefore I looked into the problem myself. The solution is to do exactly what the "Retry" button does (refresh the torrent list, which probably involves the creation of a new connection between the web script and the server daemon). In brief, to fix the problem:

1. Edit the file /Volume_1/Nas_Prog/BT/webui/fe02.asp
2. Find two statements like this:

   if (failedRequest(request)) {
      showConnectionError();
      return;
   }


and replace them with this

   if (failedRequest(request)) {
      torrentsRefresh();
   }


3. Save
4. Refresh the webpage to see the result.



P.s. To edit the files you should have telnet access (that is fun_plug installed). Either use the "vi" editor from command line or "chmod 777 fe02.asp", edit it with notepad, and "chmod 744 fe02.asp" back.

Hope this helps!

---------------
There is another way to get around the problem. It involves changing the refresh rate to a value below 0.5 seconds. To do this change this line:
   torrentsRefreshTimeout = setTimeout("torrentsRefresh()", sdkCtl.refreshFreq);
into this:
   torrentsRefreshTimeout = setTimeout("torrentsRefresh()", 400);

THIS SOLUTION WILL CAUSE THE LOAD OF DNS-323 TO GO UP FAST. That means each time you open that web page to work with BitTorrent, you are loading the machine with a lot of unnecessary work. The default refresh rate is 5000 (5 seconds) and is set in "btsdk.js" file.
--------------

P.s.2 Somebody correct me if I am wrong for anything.
Title: Re: Fixed error "Connection to server failed" for BitTorrent (fw 1.08)
Post by: OlegMZ on June 17, 2010, 06:46:28 PM
WOW! Great info! Thanks!
I did not think that this is made by scripts. It really bugs me, and is getting much worse when I have several torrents at the same time with many peers. Besides NAS performance drops dramatically - too much connections to process.
But this message is really annoying and useless to my mind. Auto refresh is much better.
Title: Re: Fixed error "Connection to server failed" for BitTorrent (fw 1.08)
Post by: galex9 on October 26, 2010, 03:34:44 PM
Hi irotjaf,

I have a similar problem, even though with FW 1.09.
The error "Connection to server failed" pops up when switching between BT pages, and sometimes "Retry" button is "frozen" and has no effect.

Would it work if I edit this script (fe02.asp or btsdk.js) in Windows.
I can access the DNS and able to open the file in Notepad, but wonder if the file saved in Windows be recognized as a valid one in Linux of DNS.

Title: Re: Fixed error "Connection to server failed" for BitTorrent (fw 1.08)
Post by: jamieburchell on October 27, 2010, 03:23:43 AM
I can access the DNS and able to open the file in Notepad, but wonder if the file saved in Windows be recognized as a valid one in Linux of DNS.

Unlike Linux shell scripts which require Linux line endings - you can get away with either with asp/php files.
Title: Re: Fixed error "Connection to server failed" for BitTorrent (fw 1.08)
Post by: galex9 on October 30, 2010, 03:16:23 PM
I have tried to edit the files from Windows, however the DNS won't let me to overwrite the edited files.
If you know the solution for Windows, it is much appreciated.

In addition I have installed Ubuntu on my laptop to use telnet as suggested.
I typed "telnet -l admin 192.168.10.100", but I get "Unable to connect to remote host".

I am a complete newbie on Linux, so I am not sure what to do when I get "connection refused".

Do I need to install fun_plug on DNS-323? Is there step by step instructions somewhere?
Title: Re: Fixed error "Connection to server failed" for BitTorrent (fw 1.08)
Post by: jamieburchell on October 30, 2010, 05:53:49 PM
Whatever file it is on the NAS you are trying to edit is likely only available to the root account of the NAS.

To have access to telnet on the NAS, you will likely want to install Fonz Fun Plug.

This is a third party modification unsupported by Dlink.

http://nas-tweaks.net/CH3SNAS:Tutorials/fun_plug (http://nas-tweaks.net/CH3SNAS:Tutorials/fun_plug)
Title: Re: Fixed error "Connection to server failed" for BitTorrent (fw 1.08)
Post by: koolzero on November 01, 2010, 06:24:29 AM
I've had my dns 323 for about a month and mine just started doing this yesterday afternoon; I have firmware 1.09.  It seems like once it starts happening I can no longer log into the configuration page on my dlink but I can still access the folders.  If I restart the dlink by using the power button I can then go into the torrent setup page for just a moment and then it will say connection failed again.

Is there any other way to edit this file without installing the fun plug?
Title: Re: Fixed error "Connection to server failed" for BitTorrent (fw 1.08)
Post by: jamieburchell on November 01, 2010, 11:01:28 AM
You could create a fun_plug script to replace the file, but really if you're not in to Linux your best bet would just be to install funplug, even if temporarily. I don't know if the suggested modification will work as I don't use it myself.
Title: Re: Fixed error "Connection to server failed" for BitTorrent (fw 1.08)
Post by: koolzero on November 01, 2010, 05:38:35 PM
ok I installed the fun plug but i can't figure out when I telnet in to get to the root of the volume_1.  I can get to the root of ffp but i can't figure out how to go back one more level.  If you could walk me through what to do that would greatly appreciated.
Title: Re: Fixed error "Connection to server failed" for BitTorrent (fw 1.08)
Post by: jamieburchell on November 02, 2010, 03:03:15 AM
ok I installed the fun plug but i can't figure out when I telnet in to get to the root of the volume_1.  I can get to the root of ffp but i can't figure out how to go back one more level.  If you could walk me through what to do that would greatly appreciated.

Shouldn't really be posting this here - use at your own risk.

Code: [Select]
cd /mnt/HD_a2/Nas_Prog/BT/webui
chmod 777 fe02.asp
(edit the file in Windows is easiest here)
chmod 744 fe02.asp
Title: Re: Fixed error "Connection to server failed" for BitTorrent (fw 1.08)
Post by: koolzero on November 02, 2010, 05:45:48 PM
Awesome.  Thanks for your help.
Title: Re: Fixed error "Connection to server failed" for BitTorrent (fw 1.08)
Post by: jamieburchell on November 03, 2010, 07:22:51 AM
No probs. Did it fix your problem?
Title: Re: Fixed error "Connection to server failed" for BitTorrent (fw 1.08)
Post by: grantpeters on November 05, 2011, 06:38:32 PM
*****************************

*************************************************************************

Its obvious from the posting, that the only solution is to install an UNSUPPORTED fix, the fun_plug so that you can HACK the code that DLink should fix.  Then after you manually fix the BUG, then uninstall the HACK so that your still supported.

***********************************************************************
******************************
Title: Re: Fixed error "Connection to server failed" for BitTorrent (fw 1.08)
Post by: Arkram on December 26, 2012, 05:33:51 AM
CONFIGURATION -> ADVANCED -> ADDITIONAL COMPONENTS -> "STOP" and after "START"

"Connection to server failed" not appared more.
Title: Re: Fixed error "Connection to server failed" for BitTorrent (fw 1.08)
Post by: saegera on August 15, 2013, 01:46:55 AM
The first change proposed by irotjaf worked for me! I did the change with WinSCP on Windows!
Title: Re: Fixed error "Connection to server failed" for BitTorrent (fw 1.08)
Post by: knkums on November 08, 2014, 08:14:07 AM
Hi all,

Today an annoying message started to appear on the BitTorrent "DOWNLOADS" list.
"Connection to server failed" (firmware 1.08)

When clicking the "Retry" button I can briefly see the download and upload speeds changing, but the error comes up suddenly after. This makes impossible to use the webpage so BitTorrent is not usable.

I couldn't find any solution around, therefore I looked into the problem myself. The solution is to do exactly what the "Retry" button does (refresh the torrent list, which probably involves the creation of a new connection between the web script and the server daemon). In brief, to fix the problem:

1. Edit the file /Volume_1/Nas_Prog/BT/webui/fe02.asp
2. Find two statements like this:

   if (failedRequest(request)) {
      showConnectionError();
      return;
   }


and replace them with this

   if (failedRequest(request)) {
      torrentsRefresh();
   }


3. Save
4. Refresh the webpage to see the result.



P.s. To edit the files you should have telnet access (that is fun_plug installed). Either use the "vi" editor from command line or "chmod 777 fe02.asp", edit it with notepad, and "chmod 744 fe02.asp" back.

Hope this helps!

---------------
There is another way to get around the problem. It involves changing the refresh rate to a value below 0.5 seconds. To do this change this line:
   torrentsRefreshTimeout = setTimeout("torrentsRefresh()", sdkCtl.refreshFreq);
into this:
   torrentsRefreshTimeout = setTimeout("torrentsRefresh()", 400);

THIS SOLUTION WILL CAUSE THE LOAD OF DNS-323 TO GO UP FAST. That means each time you open that web page to work with BitTorrent, you are loading the machine with a lot of unnecessary work. The default refresh rate is 5000 (5 seconds) and is set in "btsdk.js" file.
--------------

P.s.2 Somebody correct me if I am wrong for anything.

Hi:
Running into the same problem.. tried using your solution, but could not find "webui" directory.. i was using 1.09.. but then downgraded to 1.08.. still can't find webui.. I found the file fe02.asp in /web/web/bt/ but that is read-only file system and could not edit..

Any suggestion?

thank you
Kn