PDA

View Full Version : Issues using PSO2Proxy with AWS



MadDuckhunter
Oct 3, 2014, 12:48 PM
Alrighty, so I've been using AWS for a while now to connect to PSO2, however the proxy program I was using with it (Proxifier) was doing some strange things, and crashing my PuTTy client. Also, I wanted some of the features of the PSO2Proxy, such as global chat. So, I decided I would use PSO2Proxy to help with my AWS instance, following this guide: http://chaosinacan.com/games/pso2proxy-on-amazon-aws/

I've went through all the steps, and at the end, when running the script to start the server, I get this output:

$ ~/start-proxy
[Config] Config cfg/loginmessage.config.yml loaded!
[ShipProxy] Importing plugins.plugins...
[ShipProxy] Importing plugins.__init__...
[ShipProxy] Importing plugins.GlobalChat...
[Config] Config cfg/gchat-irc.config.yml loaded!
[Config] Config cfg/gchat.config.yml loaded!
[ShipProxy] Importing plugins.WebAPI...
[Config] Config cfg/webapi.config.yml loaded!
[Database] Connection closed!
[Database] Connection closed!
nohup: tail: /home/ec2-user/PSO2Proxy.log: file truncated
redirecting stderr to stdout

The script continues to run, but the proxy is not actually running, as trying to open config.json in the browser with my AWS public ip does not respond, nor does tweaker. IP's are setup correctly in the config files, so I'm not sure where the problem is. I'd have to imagine the two lines regarding connection closing on the database are to blame, but does anyone knowledgeable on running the proxy this way know what the issue might be? Would really like to use PSO2Proxy, just a small snag :)

Idolon
Oct 3, 2014, 08:48 PM
Nope. Those lines are normal. You do appear to have the WebAPI plug-in loaded too, so it should be working. Did you make sure to set your EC2 instance's security settings to allow all inbound and outbound traffic?

I just updated a bunch of things in the guide yesterday and fixed a bunch of problems. If you were following it then, I might still have been changing bits of it. Things are probably still wrong or could be improved, so let me know if anything doesn't work, preferably in the guide's comments, but PSO-World works too.

Also, I'm pretty sure "global" chat is only global within a particular instance of the proxy, so you'll only be able to chat with other people connected to your instance. So, if you want to let your friends use your instance, that'll work, but don't expect to be able to talk with other people using the public proxy.

MadDuckhunter
Oct 3, 2014, 10:35 PM
Thanks a bunch for the reply, and for the well written guide! Setting EC2 security settings did the trick. Of course, I had assumed that was unchanged from the other AWS guide, but apparently the original guide does not have you setting up security groups for traffic. Shows where assuming gets you lol.

However, now I am getting a server timeout on login. It is not related to an error code like normal PSO2 timeouts, just a simple "Server connection timed out." Ships are not Unknown, and the Tweaker correctly states that the server is online, so the proxy seems to be working.

I'll add my other comments to the guide, to make it easier for you to change.

Sanguine2009
Oct 4, 2014, 02:21 AM
is item translation on? i believe you have to have it on to run that through the twerker

CyberKitsune
Oct 4, 2014, 02:48 AM
Item translation shouldn't matter anymore. If you get server connection timed out, make sure your private / public keypair is correct and that your PSO2 is up to date. The Tweaker sometimes leaves you with an outdated PSO2 unless you instruct it to check for outdated or missing files.

MadDuckhunter
Oct 4, 2014, 04:03 AM
Alrighty, I've got everything fixed. Running the PSO2Proxy smoothly now! Thanks so much :) I had to add missing files in and repatch, and I also had to remove the translation.cfg file (which probably was what was actually triggering my time outs)

One last question, though. I wanted to try out some of the default disabled plugins, such as Translate.py. However, it does not seem to build. Below is the output:

[ShipProxy] Importing plugins.Translate...
Traceback (most recent call last):
File "PSO2Proxy.py", line 116, in <module>
main()
File "PSO2Proxy.py", line 106, in main
__import__(plug)
File "/home/ec2-user/PSO2Proxy/proxy/plugins/Translate.py", line 7, in <module>
from unicodescript import script
ImportError: No module named unicodescript
[Database] Connection closed!

Is there anything particular I need for the unicodescript module?

Idolon
Oct 4, 2014, 12:51 PM
Im not sure about that. Try "pip install unicodescript". Also, look on CyberKitsune's GitHub page about that, since it requires some other modules which aren't installed by default.

My guide has you install Python 2.7, because Amazon Linux AMI comes with 2.6 installed, and that's ancient. There are probably a bunch of modules that are already installed for 2.6 but not 2.7. If you hit one that it can't find, try using pip to install it.

MadDuckhunter
Oct 4, 2014, 07:53 PM
That did the trick, although I still had to do another sudo easy_install for unicodescript to get it to build. Translate and EQAlerts are both working for me now. Thanks again for the great guide, and thanks CyberKitsune for the awesome proxy!

Misaki Ki
Oct 5, 2014, 02:11 AM
Im not sure about that. Try "pip install unicodescript". Also, look on CyberKitsune's GitHub page about that, since it requires some other modules which aren't installed by default.

My guide has you install Python 2.7, because Amazon Linux AMI comes with 2.6 installed, and that's ancient. There are probably a bunch of modules that are already installed for 2.6 but not 2.7. If you hit one that it can't find, try using pip to install it.


Looked over your guide a bit. I agree with Python 2.7. I've only had issues with 2.7, and helping people use that.

Is there any reason you don't use 'screen' for the proxy?

Idolon
Oct 5, 2014, 02:28 PM
Is there any reason you don't use 'screen' for the proxy?

For one, I don't know what that is. What is 'screen'?

DJcooltrainer
Oct 6, 2014, 08:49 AM
For one, I don't know what that is. What is 'screen'?

Screen allows you to multi-task, kind of like switching between multiple terminal sessions. It's really handy if you want to do other things with your server while PSO2Proxy is running.

You can also send PSO2Proxy to run as a background process, but I ran into an issue with the script randomly stopping when I'm trying to input other command sometimes.

If you aren't doing anything else with your server, it's not really necessary imo.

Idolon
Oct 7, 2014, 05:13 PM
Ah. If you close your SSH session, does that kill screen and therefore all the programs running through it? I use nohup to start the server and tail the log file so that you can see the server's output, but closing your SSH session doesn't kill the server. Otherwise, you're still at the mercy of PuTTY deciding to randomly fail, close the session, and kill PSO2Proxy in the process.

Idolon
Oct 14, 2014, 01:27 PM
Also, I'm pretty sure "global" chat is only global within a particular instance of the proxy, so you'll only be able to chat with other people connected to your instance. So, if you want to let your friends use your instance, that'll work, but don't expect to be able to talk with other people using the public proxy.

Actually, now that I've taken a look at PSO2Proxy's code, it looks like the global chat plug-in runs through an IRC channel, configured via proxy/cfg/gchat-irc.config.yml. If configured to use the same IRC server as the public PSO2Proxy (maybe irc.badnik.net, #pso2proxypublic ?), your global chat should indeed be global.

MadDuckhunter
Oct 15, 2014, 03:26 AM
Nice catch. I've went back through and re-setup the proxy with these settings on my irc.config.yml:

autoexec: []
channel: '#pso2proxypublic'
enabled: true
nick: PSO2IRCBot
output: true
port: 6667
server: irc.badnik.net

I get a form of confirmation on my proxy startup, however I cannot maintain a connection to the IRC server, and will always lose connection after everything is set up. Below is my output from start-proxy:

$ ~/start-proxy
[ShipProxy] Importing plugins.WebAPI...
[Config] Config cfg/webapi.config.yml loaded!
[GlobalChat] IRC Connected!
[IRC] [NOTICE] irc.badnik.net *** Looking up your hostname...
//Omitted the IP in the line below
[IRC] [NOTICE] irc.badnik.net *** Found your hostname () -- cached
[IRC] [NOTICE] irc.badnik.net Welcome to BadnikNET!
[GlobalChat] Joined #pso2proxypublic
[GlobalChat] IRC Connection lost!
[Database] Connection closed!
[Database] Connection closed!
tail: /home/ec2-user/PSO2Proxy.log: file truncated
nohup: redirecting stderr to stdout

Interesting enough, while trying to debug this error I was able to get a chat message from the IRC channel in-between setup and the connection loss message, but my friend who was currently logged in to PSO2Proxy on the normal Tweaker method did not see it. Any ideas on maintaining the IRC connection? Thanks so much for the help so far!

Idolon
Oct 16, 2014, 01:57 PM
No idea. I've only skimmed over the code and suggested using the IRC channel listed on the PSO2Proxy GitHub page. You'd have to ask CyberKitsune how the chat plug-in is supposed to be configured.

Twinblaze
Oct 16, 2014, 06:37 PM
Figured I'd make a post here instead of starting up a new thread. I just tried to set up PSO2Proxy, but apparently something went wrong. The server is responding, and when I start up the proxy I get all the normal stuff that the creator of this thread got. I can login just fine, but when I try to actually get into the game (after character select), it says the connection to the server was lost [Error 630]

I just updated PSO2, I've checked my security groups and tried updating all the keys, nothing seems to work.

I know absolutely nothing about this sort of thing, but here's the part of the PuTTY output that seems like it might be relevant.

[SPOILER-BOX]
File "/usr/lib64/python2.7/site-packages/twisted/python/context.py", line 81, in callWithContext
return func(*args,**kw)
--- <exception caught here> ---
File "/usr/lib64/python2.7/site-packages/twisted/internet/posixbase.py", line 614, in _doReadOrWrite
why = selectable.doRead ()
File "/usr/lib64/python2.7/site-packages/twisted/internet/tcp.py", line 214, in doRead
return self._dataReceieved(data)
File "/usr/lib64/python2.7/site-packages/twisted/internet/tcp.py", line 220, in _dataReceived
rval = self.protocol.dataReceived(data)
File "/home/ec2-user/PSO2Proxy/proxy/ShipProxy.py", line 121, in dataReceived
f(self)
File "/home/ec2-user/PSO2Proxy/proxy/plugins/GlobalChat.py", line 141, in check_config
"[Proxy] {yel} |clipped chat instructions|" % (config.globalConfig.get_key('commandPrefix'), config.globalConfig.get_key('commandPrefix')), exceptions.TypeError:not enough arguments for format string
[/SPOILER-BOX]

Idolon
Oct 17, 2014, 03:30 PM
That is either bug in the GlobalChat.py plug-in, or you've set up said plug-in incorrectly. I suggest you head over to the PSO2Proxy GitHub page and open a new issue (https://github.com/cyberkitsune/PSO2Proxy/issues) for this. In the meantime, try disabling global chat and trying again.

Twinblaze
Oct 17, 2014, 03:59 PM
In the meantime, try disabling global chat and trying again.
Sounds good.

Um.... how exactly to I do that? (I wasn't kidding about knowing absolutely nothing)

Idolon
Oct 22, 2014, 01:02 AM
Look in the plugins folder. There's something like GlobalChat.py. Move that to the disabled folder.