mage icon indicating copy to clipboard operation
mage copied to clipboard

Occasionally cannot submit deck after sideboarding

Open jumpinjackie opened this issue 4 years ago • 3 comments

Version: git master (62bc6ed848164044b7d757f98ae2ac70aa71fe30)

I've been goldfishing several 8 player MTGO Vintage Cube elimination drafts against all AI opponents, and I have been noticing that when I go to sideboarding, sometimes the server will enter a state where I can no longer submit the deck. Once in this state, it will always occur every time you finish a game and enter this UI for sideboarding.

Here's an example screenshot:

2021-12-06 23_19_42-

The stack trace from the server output at this time was:

ERROR 2021-12-06 23:19:23,333 Error finding card from DB : org.h2.jdbc.JdbcSQLException: General error: "java.lang.IllegalStateException: Reading from nio:C:/Workspace/mage/Mage.Server/db/cards.h2.mv.db failed; file length -1 read length 384 at 212186814 [1.4.197/1]"; SQL statement:
SELECT * FROM `card` WHERE (`setCode` = ? AND `cardNumber` = ? AND `nightCard` = ?) LIMIT 1 [50000-197] =>[WorkerThread#2[192.168.0.4:62101]] CardRepository.findCard 
ERROR 2021-12-06 23:19:23,334 Tried to restart the DB: not successful                                                    =>[WorkerThread#2[192.168.0.4:62101]] Deck.createCardNotFoundGameException 
FATAL 2021-12-06 23:19:23,334                                                                                            =>[WorkerThread#2[192.168.0.4:62101]] MageServerImpl.handleException 
mage.game.GameException: Card not found - Wooded Foothills - KTK/249 for deck - null
Possible reason is, that you use cards in your deck, that are only supported in newer versions of the server.
So it can help to use the same card from another set, that's already supported from this server.
	at mage.cards.decks.Deck.createCardNotFoundGameException(Deck.java:146)
	at mage.cards.decks.Deck.load(Deck.java:103)
	at mage.cards.decks.Deck.load(Deck.java:73)
	at mage.server.TableController.submitDeck(TableController.java:416)
	at mage.server.TableManagerImpl.submitDeck(TableManagerImpl.java:178)
	at mage.server.MageServerImpl$6.execute(MageServerImpl.java:349)
	at mage.server.MageServerImpl$6.execute(MageServerImpl.java:341)
	at mage.server.MageServerImpl.executeWithResult(MageServerImpl.java:1181)
	at mage.server.MageServerImpl.submitDeck(MageServerImpl.java:341)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.jboss.remoting.transporter.TransporterHandler.invoke(TransporterHandler.java:87)
	at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:967)
	at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:798)
	at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:751)
	at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:586)
	at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:234)

The only workaround for this issue was to just let the sideboarding timer run out. I do not know if when the deck is submitted on timer expiry, that the submitted deck contains my sideboarding changes or not.

jumpinjackie avatar Dec 06 '21 12:12 jumpinjackie

It's a memory limitation for a server. Try to increase max memory usage for java from 500 Mb to 1000 Mb by -Xmx1000m

IntelliJ IDE server settings example: shot_211206_170340

JayDi85 avatar Dec 06 '21 13:12 JayDi85

@jumpinjackie Did that fix your issue?

Alex-Vasile avatar Aug 04 '22 18:08 Alex-Vasile

Still happened sporadically, but I haven't been using mage that often lately to find out if the problem still persists

jumpinjackie avatar Aug 04 '22 23:08 jumpinjackie