ServerSync

ServerSync

48.5k Downloads

Server crash due to config folder not in blacklist mode

syndicate25 opened this issue ยท 6 comments

commented

Serversync Version: 2.6.19

Minecraft Version: 1.7.10

Issue:

Server crash due to config folder not in blacklist mode
If I don't set the config folder in blacklist mode by adding it to the DIRECTORY_INCLUDE_LIST, it causes a server crash.  

Here's a simple example:

Does NOT work:

rules {
S:CONFIG_INCLUDE_LIST <
adventurebackpack.cfg
>

S:DIRECTORY_INCLUDE_LIST <
    mods
>

S:FILE_IGNORE_LIST <
>

DOES work:

rules {
S:CONFIG_INCLUDE_LIST <
adventurebackpack.cfg
>

S:DIRECTORY_INCLUDE_LIST <
config
    mods
>

S:FILE_IGNORE_LIST <
>

Here's the crash report:

Time: 7/4/18 11:14 AM
Description: Exception in server tick loop

java.lang.NullPointerException: Exception in server tick loop
at com.superzanti.serversync.filemanager.FileManager.getConfigurationFiles(FileManager.java:74)
at com.superzanti.serversync.ServerSetup.(ServerSetup.java:105)
at runme.Main.runInServerMode(Main.java:96)
at runme.Main.main(Main.java:46)
at com.superzanti.serversync.forgeloader.ForgeLoaderCPW.startServersync(ForgeLoaderCPW.java:14)
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 cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:532)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:212)
at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:190)
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 com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
at com.google.common.eventbus.EventBus.post(EventBus.java:275)
at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:119)
at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:556)
at cpw.mods.fml.server.FMLServerHandler.beginServerLoading(FMLServerHandler.java:88)
at cpw.mods.fml.common.FMLCommonHandler.onServerStart(FMLCommonHandler.java:314)
at net.minecraft.server.dedicated.DedicatedServer.func_71197_b(DedicatedServer.java:117)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:387)
at net.minecraft.server.MinecraftServer$2.run(MinecraftServer.java:685)

commented

Most interesting indeed.

I do not appear to be able to reproduce this in either standalone or forge loaded.

It is somewhat possible that the fix for finding the Minecraft directory in 2.6.20 resolved this.

My Test Config (using minecraft 1.12 for what its worth):

# Configuration file

general {
    B:PUSH_CLIENT_MODS=false
}

rules {
    S:CONFIG_INCLUDE_LIST <
        adventurebackpack.cfg
    >

    S:DIRECTORY_INCLUDE_LIST <
        mods
    >

    S:FILE_IGNORE_LIST <
        mods/test/**
    >
}

misc {
    S:LOCALE=en_NZ
}
commented

Unfortunately it seems the issue still exists.

Here's my actual current config so you can see if perhaps I did something wrong:

https://pastebin.com/7CVkhkfK

Here's the latest crash report:

https://pastebin.com/t6vFSvMD

Again, I can solve this by adding "config" to the DIRECTORY_INCLUDE_LIST but I don't want that. I want to specify what to use the whitelist, not the blacklist.

Another interesting behavior on the client side - It syncs all the configs, and then and the end during the deletion phase, it deletes them all, including serversync's client config.

Perhaps you can help me understand the purpose of the client config, since it appears the server config controls everything?

This is what I currently have, but I have tried the default config with just "clientmods", added all the config files by name to the list including directories, and then this more simplified version, which might be completely wrong for 2.6.20:

https://pastebin.com/JijFY1cy

commented

Configs

The client config is for the person trying to connect to a server. It enables stories like:
"As a client I want to be able to use client specific mods like Optifine without ServerSync deleting them"

Essentially it lets the client list a set of files that they want ServerSync to ignore.

The server configuration is for the server admin, it enables stories like:
"As a server admin I want to be able to use server specific mods like Morpheus without sending them to my clients".

We have two parties in the dialogue who want similar things but each has different items they care about excluding from the process.

Clientmods Directory

This is a special directory that is created by ServerSync, it is intended for server admins to add client specific mods that can enhance the experience for a player but are not required to connect to the server.

These mods have no guarentee of being present on the cleint after a sync as the client can configure ServerSync to refuse them, this is to give power to players who may have their own favourite client mods that provide the same functionality or may conflict with the servers client mods.

You should not need to do anything with this directory other than put mods in it and change the 'push_client_mods' config entry to true, ServerSync handles the rest from there (or it should anyway).

Config Include List

This list is resolved relative to the config directory, so your last configuration there would not include anything.

commented

It is possible that somehow the root directory for ServerSync is being resolved to something other than the folder that contains:

  • mods
  • config
  • logs
    etc.

I'll add some logging of the root dir that ServerSync is working from.

commented

I'm thinking of restructuring the include / ignore lists.

My current plan is to just have a more standard include with exclude composed on top.
e.g.

file_include_list <
  mods/**
  config/**
  public/map-config.xml
>

file_ignore_list <
  **/*.badfile
  mods/foo.jar
  config/serverstuff/**
>

glob patterns can support adding whole directories so the directory include list & config whitelist are redundant.

commented

Added in v4