Port forwarding Deluge Spit Tunnel Script Error?
|
Posts: 7
Threads: 2
Joined: Jan 2017
Reputation:
0
[Not Solved]
Jan 28, 2017, 08:21 AM
Hello again,
After getting transmission up and running using port forwarding/spit tunnel script I was excited to see the new guide for using it will deluge. However, I seem to be having an issue when testing the portforward.sh script. I believe I followed the guide quite well, but I am getting the following reply from the test run:
Code:
sudo bash /etc/openvpn/portforward.sh
173.199.65.4
iptables v1.6.0: invalid port/service `-j' specified
Try `iptables -h' or 'iptables --help' for more information.
malformed expression (,)
[ERROR ] 23:16:27 main:347 malformed expression (,)
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/main.py", line 344, in do_command
ret = self._commands[cmd].handle(*args, **options.__dict__)
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 102, in handle
return self._set_config(*args, **options)
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 136, in _set_config
val = simple_eval(options["set"][1] + " " .join(args))
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 85, in simple_eval
res = atom(src.next, src.next())
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 54, in atom
out.append(atom(next, token))
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 77, in atom
raise SyntaxError("malformed expression (%s)" % token[1])
SyntaxError: malformed expression (,)
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/main.py", line 344, in do_command
ret = self._commands[cmd].handle(*args, **options.__dict__)
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 102, in handle
return self._set_config(*args, **options)
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 136, in _set_config
val = simple_eval(options["set"][1] + " " .join(args))
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 85, in simple_eval
res = atom(src.next, src.next())
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 54, in atom
out.append(atom(next, token))
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 77, in atom
raise SyntaxError("malformed expression (%s)" % token[1])
SyntaxError: malformed expression (,)
As always, thanks in advance for figuring out where I went wrong.
M
Posts: 244
Threads: 1
Joined: Jul 2016
Reputation:
12
[Not Solved]
Jan 28, 2017, 11:47 AM
(This post was last modified: Jan 28, 2017, 11:52 AM by drake.)
I am from phone now, but can you try to run the script without bash, like this:
sudo /etc/openvpn/portforward.sh
We will certainly make this work, as it is working for me and others also tested the script and reported back it is working fine.
Posts: 7
Threads: 2
Joined: Jan 2017
Reputation:
0
[Not Solved]
Jan 28, 2017, 03:39 PM
(This post was last modified: Jan 28, 2017, 04:08 PM by halfrican.)
ran the script with bash, similar results:
173.199.65.4
iptables v1.6.0: invalid port/service `-j' specified
Try `iptables -h' or 'iptables --help' for more information.
malformed expression (,)
[ERROR ] 06:38:10 main:347 malformed expression (,)
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/main.py", line 344, in do_command
ret = self._commands[cmd].handle(*args, **options.__dict__)
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 102, in handle
return self._set_config(*args, **options)
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 136, in _set_config
val = simple_eval(options["set"][1] + " " .join(args))
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 85, in simple_eval
res = atom(src.next, src.next())
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 54, in atom
out.append(atom(next, token))
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 77, in atom
raise SyntaxError("malformed expression (%s)" % token[1])
SyntaxError: malformed expression (,)
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/main.py", line 344, in do_command
ret = self._commands[cmd].handle(*args, **options.__dict__)
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 102, in handle
return self._set_config(*args, **options)
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 136, in _set_config
val = simple_eval(options["set"][1] + " " .join(args))
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 85, in simple_eval
res = atom(src.next, src.next())
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 54, in atom
out.append(atom(next, token))
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 77, in atom
raise SyntaxError("malformed expression (%s)" % token[1])
SyntaxError: malformed expression (,)
i just went back and deleted the portforward.sh, iptables.sh, and rebuilt them. Now running the portforward.sh is returning the results desired. Not sure what was wrong with my entries before.
When i view the deluge network settings i see that the port is assigned in the "incoming" field. However, I notice the the "outgoing" ports are blank. is this correct? "random ports" are unchecked as described in the deluge configuration guide.
Thanks!
Posts: 244
Threads: 1
Joined: Jul 2016
Reputation:
12
[Not Solved]
Jan 28, 2017, 05:19 PM
Excellent, glad it is working now. Yes, that is correct, outgoing ports should not be used, you have configured everything as it should.
Sent from Tapatalk from my Z5 Compact
Posts: 1
Threads: 0
Joined: Feb 2017
Reputation:
0
[Not Solved]
Feb 18, 2017, 06:10 AM
(This post was last modified: Feb 18, 2017, 06:11 AM by CKhAtERGLaDeNOct.)
(Jan 28, 2017, 05:19 PM)drake Wrote: Excellent, glad it is working now. Yes, that is correct, outgoing ports should not be used, you have configured everything as it should.
Sent from Tapatalk from my Z5 Compact
Not to bring up an old thread, but I have the exact same issue, same error code:
--------@---------:~$ sudo bash /etc/openvpn/portforward.sh
XXX.XXX.XXX.XXX
iptables v1.6.0: invalid port/service `-j' specified
Try `iptables -h' or 'iptables --help' for more information.
malformed expression (,)
[ERROR ] 22:00:06 main:347 malformed expression (,)
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/main.py", line 344, in do_command
ret = self._commands[cmd].handle(*args, **options.__dict__)
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 102, in handle
return self._set_config(*args, **options)
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 136, in _set_config
val = simple_eval(options["set"][1] + " " .join(args))
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 85, in simple_eval
res = atom(src.next, src.next())
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 54, in atom
out.append(atom(next, token))
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 77, in atom
raise SyntaxError("malformed expression (%s)" % token[1])
SyntaxError: malformed expression (,)
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/main.py", line 344, in do_command
ret = self._commands[cmd].handle(*args, **options.__dict__)
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 102, in handle
return self._set_config(*args, **options)
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 136, in _set_config
val = simple_eval(options["set"][1] + " " .join(args))
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 85, in simple_eval
res = atom(src.next, src.next())
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 54, in atom
out.append(atom(next, token))
File "/usr/lib/python2.7/dist-packages/deluge/ui/console/commands/config.py", line 77, in atom
raise SyntaxError("malformed expression (%s)" % token[1])
SyntaxError: malformed expression (,)
I've gone through and deleted/rebuilt the same scripts that the OP did to fix his/her problem but to no avail. Any idea what might be causing this? FWIW I also got a similar error when I was trying to set it up with Transmission. I got everything set up, but becaue I don't havea forwarded port nothing is downloading. I've gone through your guides a few times and I'm feeling lost at this point
Thanks as always for your help!!
Posts: 45
Threads: 4
Joined: Mar 2017
Reputation:
5
[Not Solved]
Mar 09, 2017, 08:10 AM
(This post was last modified: Mar 09, 2017, 08:12 AM by Lt Hawk.
Edit Reason: added underlined to clarify what was returning blank
)
PIA broke the API:
https://www.privateinternetaccess.com/fo...api#latest
Im working on a new script for this... I'll race you -__-
that being said. since the link used in the script we are using it returns <blank> for the "$port" variable , therefore:
Code:
sudo iptables -I INPUT 2 -i $VPNINTERFACE -p tcp --dport $PORT -j ACCEPT
for example is attempting to use "-j" as a value which is bad syntax... snowballs!!!
In addition, when running deluge console... for whatever reason mine tries to read the config from my main user instead of 'vpn' so i needed to update that last line to:
Code:
deluge-console -c /home/vpn/.config/deluge "connect $DELUGEHOST:58846 $DELUGEUSER $DELUGEPASS; config -s listen_ports ($PORT,$PORT)"
I tested this outside of the script with subbed values and it works fine.
however somewhere, my vpn internet is now broken bc of that silly api nonsense.. time to rollback. lol
Posts: 244
Threads: 1
Joined: Jul 2016
Reputation:
12
[Not Solved]
Mar 09, 2017, 08:53 AM
Hi wowbutters@gmail.com
we already have the new script ready for the new PIA API, but there are some problems when you try to run the script with OpenVPN up call. Then the new script just doesn't work. If you run the new script manually within the 2 minutes time frame after establishing VPN connection, then script works perfectly fine and port number is there.
We are waiting for PIA's update on this, but they are not too fast to react to this issue.
Did you manage to run the script for the new API with OpenVPN up call?
Note, you need to run the script once connected to the VPN server, therefore you need a routing rule to route traffic to the API IP&port or you need to run the script as vpn user (is using split tunnel). I got this resolved, the problem I'm facing, like I said, is to run the script with OpenVPN up. Maybe you have an idea, please share with us, if any.
Posts: 45
Threads: 4
Joined: Mar 2017
Reputation:
5
[Not Solved]
Mar 09, 2017, 09:11 PM
ok, this is weird. I rebuilt iptables.sh and port_forwarding.sh for comparisons etc while working with the new api. and i ran p_f.sh to look at the errors and it worked -_-. but the script provided by PIA isn't? I'm wondering if it is because I am already assigned a port? Even if i reboot. hmm. I wonder if i change servers what will happen. I want to figure this out before they do break it lol.
Posts: 45
Threads: 4
Joined: Mar 2017
Reputation:
5
[Not Solved]
Mar 09, 2017, 10:31 PM
(Mar 09, 2017, 08:53 AM)drake Wrote: Hi wowbutters@gmail.com
we already have the new script ready for the new PIA API, but there are some problems when you try to run the script with OpenVPN up call. Then the new script just doesn't work. If you run the new script manually within the 2 minutes time frame after establishing VPN connection, then script works perfectly fine and port number is there.
We are waiting for PIA's update on this, but they are not too fast to react to this issue.
Did you manage to run the script for the new API with OpenVPN up call?
Note, you need to run the script once connected to the VPN server, therefore you need a routing rule to route traffic to the API IP&port or you need to run the script as vpn user (is using split tunnel). I got this resolved, the problem I'm facing, like I said, is to run the script with OpenVPN up. Maybe you have an idea, please share with us, if any.
As I said in my second post I can't get it to pull, but thus far that's the only error since I used an if/fi to avoid deluge errors from a null return. But it's the same result as the stock pia script so I can't conclude any further at this moment. I'm not at my terminal so I can't try changing which server ie to Germany and try pulling a new port. That being said I haven't gotten far enough to adjust up scripts. However I found this:
Quote:Okay- in my case the issue was my older route up scripts for openvpn needed updating. I use ip route/rule commands for split tunneling, so needed to add an "ip rule add from all to 209.222.18.222 lookup 10" to ensure the curl connection goes through the VPN'd interface. Once that change was made I successfully got a port... Thanks!
Which may do what we need. I'm still a little dirty in bash but I have a knack for pulling script apart and knowing what it does. The syntax just takes a bit more ?
Posts: 244
Threads: 1
Joined: Jul 2016
Reputation:
12
[Not Solved]
Mar 10, 2017, 08:53 AM
(This post was last modified: Mar 10, 2017, 08:54 AM by drake.)
@wowbutters@gmail.com
I sent you a PM!
I know about the routing rule, but first we need to make it work without Split Tunnel. Don't even try to add Deluge change, just complicates things. Just try to get the port number with the new script on a base OpenVPN configuration (for example, print the port number to a port.log file). If that works, we already have a new script that will take care of Transmission and Deluge port change.
At the moment, we can't make the new PIA script work with OpenVPN up call.
|
|
Recent Posts
|
Update Spotweb and PHP
jonescelinaa Aug 21, 2024, 03:54 AM
|
Bibliography For A Book
Aeliyana114 Aug 09, 2024, 05:01 PM
|
Fly With Monkey Mart: Colorful Virtual Supermark...
jonescelinaa Jul 09, 2024, 09:44 AM
|
Find My IP Address - Kodi - Updated
jonescelinaa Jul 09, 2024, 09:42 AM
|
Supreme Сasual Dating - Legitimate Girls
Aeliyana114 Jun 23, 2024, 05:45 PM
|
Latest unread posts | Unanswered posts |
|