I have finally managed to get an app loaded onto an AWS Lightsail instance. The app utilises a financial python library called quickfix. Required a few tweaks to finally get it loaded, however the final stage is to get it to connect to a counterparty. The quickfix library seems to initiate, however the final block is an error as below. Is this something that relates to the Anvil App Server, or one of my libraries?
If so, how do I go about debugging/logging further to diagnose and fix?
Many thanks!
Apologies in advance for not being clear in my questions! I have made some progress, I had to wrap up a function. Next error is slightly more informative I hope:
My code is as below:
import anvil.server
import sys
import time
from sqlalchemy import create_engine
import quickfix as fix
fileName = "/home/ubuntu/setting_initiator.cfg"
class Application(fix.Application):
def onCreate(self, sessionID):
print("Created session as initiator")
def onLogon(self, sessionID):
print("Logged in")
def onLogout(self, sessionID): return
def toAdmin(self, message, sessionID): return
def toApp(self, message, sessionID):
print("Sent a message")
def fromAdmin(self, message, sessionID): return
def fromApp(self, message, sessionID): return
@anvil.server.callable
def kickoff():
settings = fix.SessionSettings(fileName)
application = Application()
storeFactory = fix.FileStoreFactory(settings)
logFactory = fix.ScreenLogFactory(settings)
initiator = fix.SocketInitiator(application, storeFactory, settings, logFactory)
initiator.start()
print("Started initiator")
I went back to basics, created the simplest of apps without any additional libraries etc. Literally just returns a print, and ends up with the same error message. I’m concluding that not related to the libraries and perhaps my setup? Any pointers?
Chris,
This probably won’t be of help to you, but I ran into constant weirdness and problems trying to get a simple anvil app + the app server running on a lightsail instance (I don’t remember which OS image). Never did get it working.
Since then, I’ve been running the app server on Ubuntu and Debian VPS elsewhere and it’s been without issue.
Ken.