Page MenuHomeSchine - Phabricator

Starmade | Systems 2.0 - Sector Imports are failing with ClassCastException - Exports seem corrupted when including docked entities
Closed, FinishedPublic

Description

Newly created sector exports are failing to import, stating a ClassCastException as the fault.

I imported a sector export called "TheHub" to sector 50 50 50. I made a few changes. Then did a /force_save, waited, and then did a /sector_export to save the changes to a new export file. I then attempted to import the newly created export to sector 60 60 60 to verify it and the import operation failed with a class cast exception.

These ships are part of a "Hub" area, where we sell filled blueprint for bronze bars. We hand out bronze bars as prizes for doing quests and participating in admin events.

So, I tried some more combinations of things.
When saving only ONE ship entity that has newly filled blueprints in it's storage, it also failed.

When saving only ONE ship entity that has NO filled storages.

I then tried saving a few new sector exports, one being blank and the other with only a NEW single core.

Both were successful.

I then took an old ship which was only a power reactor (old) and thruster. I saved a sector export and reimported it.

This was successful.

So then I tried importing the sector export, "TheHub" to sector 50 50 50 again. This time I changed nothing. I did a /force_save and ran "/sector_export 50 50 50 TheHub-TheTest". I then attempted to import this sector to 60 60 60 and it failed with a "ClassCastException: Null" error.

I do not know what is causing the error. Perhaps the fact that entities are docked to each other? I will continue testing and see if I can find the root cause and will update this if I'm successful.

Here are the sector exports:
TheHub - This will load in correctly. This export was created prior to the Systems 2.0 update.

TheHub-TheTest - This will NOT load correctly. This is simply a resave of TheHub with no changes made, AFTER the systems 2.0 update.

Edit: Upon further testing, it seems that when a any entities are DOCKED within the sector when the export is done, it corrupts.

Details

Task Type
Bug
Testing Results
Affected Gamemode(s)
Single and Multi
Reproducible
Yes
Last tested (version)
0.200.323
Category
none/unspecified
First occurrence (version)
0.200.315
Hardware/Software/System
OS-Specific
No
Hardware-Specific
No
Video Card Vendor
uncertain
Steps to reproduce

I included sector exports in the description for you to use to recreate the problem.

1. Import TheHub.smsec to sector 50 50 50.
2. Run a /force_save, wait a bit for it to complete. Then export sector 50 50 50 to "TheHub-whatever". (Command: /export_sector 50 50 50 TheHub-whatever)
3. Try to import the export you just made. /import_sector 60 60 60 TheHub-whatever

It should fail with a class cast exception.

To recreate one of the issues without using the sector export:

  1. Create a ship and a station. Dock the ship to the station.
  2. Create a sector export of the sector.
  3. Try to import the sector-export you just created. It will fail.
Serverconfig (server.cfg)
 <replace this block with the file content, 
but do not remove the first and last line. 
Before using the paste function, mark the area from the 
opening angle bracket to the closing angle bracket>
Clientconfig (settings.cfg)
 <replace this block with the file content, 
but do not remove the first and last line. 
Before using the paste function, mark the area from the 
opening angle bracket to the closing angle bracket>

Event Timeline

Benevolent27 updated the task description. (Show Details)
Benevolent27 edited Steps to reproduce. (Show Details)
Benevolent27 renamed this task from Systems 2.0 - Sector Exports are failing with ClassCastException to Systems 2.0 - Sector Imports are failing with ClassCastException - Exports seem corrupted when including docked entities.
lancake added a subscriber: lancake.
lancake changed the task status from Open to In Queue.

-validated- & - confirmed-

Great info, including stacktrace below and putting in queue:

java.lang.ClassCastException: [Lorg.schema.schine.resource.tag.Tag; cannot be cast to java.lang.String
	at org.schema.schine.resource.tag.Tag.getString(Tag.java:1302)
	at org.schema.game.common.controller.rails.RailController.postfixExpected(RailController.java:323)
	at org.schema.game.common.controller.rails.RailController.addPostfixToTagUIDS(RailController.java:312)
	at org.schema.game.server.controller.SectorUtil.changeUIDIfExists(SectorUtil.java:190)
	at org.schema.game.server.controller.SectorUtil.importSectorFullDir(SectorUtil.java:504)
	at org.schema.game.server.controller.SectorUtil.importSector(SectorUtil.java:615)
	at org.schema.game.server.data.SectorImportRequest.execute(SectorImportRequest.java:28)
	at org.schema.game.server.controller.GameServerController.update(GameServerController.java:982)
	at org.schema.schine.network.server.ServerController.run(ServerController.java:275)
	at java.lang.Thread.run(Thread.java:745)
EXCEPTION OCCURRED: REMOVING TMP FILES
[SEND][SERVERMESSAGE] sector importing failed: IOException: ClassCastException: [Lorg.schema.schine.resource.tag.Tag; cannot be cast to java.lang.String to RegisteredClient: Lancake (1) connected: true
java.io.IOException: ClassCastException: [Lorg.schema.schine.resource.tag.Tag; cannot be cast to java.lang.String
	at org.schema.game.server.controller.SectorUtil.importSectorFullDir(SectorUtil.java:610)
	at org.schema.game.server.controller.SectorUtil.importSector(SectorUtil.java:615)
	at org.schema.game.server.data.SectorImportRequest.execute(SectorImportRequest.java:28)
	at org.schema.game.server.controller.GameServerController.update(GameServerController.java:982)
	at org.schema.schine.network.server.ServerController.run(ServerController.java:275)
	at java.lang.Thread.run(Thread.java:745)
Restricted Application removed a project: Issue Navigation. · View Herald TranscriptFeb 2 2018, 12:28 PM
lancake shifted this object from the S1 Public space to the S3 Starmade space.Feb 2 2018, 12:28 PM
lancake changed the visibility from "Custom Policy" to "Public (No Login Required)".
lancake changed the edit policy from "Task Author" to "Starmade (Project)".
lancake changed Affected Gamemode(s) from none/unspecified to Single and Multi.
lancake changed Reproducible from uncertain to Yes.
lancake changed Last tested (version) from v0.200.315 to 0.200.323.
lancake set First occurrence (version) to 0.200.315.
lancake claimed this task.
lancake raised the priority of this task from Normal to Release Blocker.
Restricted Application added a project: Game Development. · View Herald TranscriptFeb 2 2018, 12:29 PM
lancake changed the task status from In Queue to Resolved.Feb 2 2018, 3:51 PM
Restricted Application edited projects, added Quality Assurance; removed Game Development. · View Herald TranscriptFeb 2 2018, 3:51 PM
Restricted Application added a subscriber: AndyP. · View Herald Transcript
lancake closed this task as Closed.

-QA Testing-

Fix confirmed.

Restricted Application removed a project: Quality Assurance. · View Herald TranscriptFeb 2 2018, 3:51 PM
Restricted Application removed a subscriber: AndyP. · View Herald Transcript