literalplus / commandblockerultimate

Blocks commands and does it well, or at least it thinks so. Compatible with BungeeCord and Spigot!
http://j.l1t.li/cmdblk
GNU General Public License v2.0
6 stars 5 forks source link

Config not saving #45

Closed xXBlazeCraftXx closed 6 years ago

xXBlazeCraftXx commented 6 years ago

https://pastebin.com/75bV7TKz this is my config and when i do the bungee command to reload it says that the config is bad but if I put it in yaml parser it says it's fine.

literalplus commented 6 years ago

Hi, thanks for reporting this issue!

Try quoting the weird calc commands with single quotes '. Also make sure to know that the current version of cbu doesn't block subcommands. You can only block the whole calc command.

If that doesn't help, please check your server console for an error message. There should be one there.

If I understand correctly what you're trying to do, blocking these specific snippets won't help because an adversary could just change the variable names.

On Sun, 8 Apr 2018, 17:56 xXBlazeCraftXx, notifications@github.com wrote:

https://pastebin.com/75bV7TKz this is my config and when i do the bungee command to reload it says that the config is bad but if I put it in yaml parser it says it's fine.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/xxyy/commandblockerultimate/issues/45, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhY_s2IAO5TF-0MijwDjG5lBf6OumIeks5tmjMWgaJpZM4TLlzQ .

literalplus commented 6 years ago

Oh, also, the target-commands are supposed to be without the slash /. Just calc is the correct syntax.

On Sun, 8 Apr 2018, 21:11 Philipp Nowak, me@l1t.li wrote:

Hi, thanks for reporting this issue!

Try quoting the weird calc commands with single quotes '. Also make sure to know that the current version of cbu doesn't block subcommands. You can only block the whole calc command.

If that doesn't help, please check your server console for an error message. There should be one there.

If I understand correctly what you're trying to do, blocking these specific snippets won't help because an adversary could just change the variable names.

On Sun, 8 Apr 2018, 17:56 xXBlazeCraftXx, notifications@github.com wrote:

https://pastebin.com/75bV7TKz this is my config and when i do the bungee command to reload it says that the config is bad but if I put it in yaml parser it says it's fine.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/xxyy/commandblockerultimate/issues/45, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhY_s2IAO5TF-0MijwDjG5lBf6OumIeks5tmjMWgaJpZM4TLlzQ .

xXBlazeCraftXx commented 6 years ago

Thing is i did all that testing myself and it still gave the same error

literalplus commented 6 years ago

No error message in console? If not, you can also try creating a new configuration from scratch (just move the existing one or get the default at https://github.com/xxyy/commandblockerultimate/blob/master/spigot/src/main/resources/config.yml) and add your changes one by one.

On Sun, 8 Apr 2018, 21:28 xXBlazeCraftXx, notifications@github.com wrote:

Thing is i did all that testing myself and it still gave the same error

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/xxyy/commandblockerultimate/issues/45#issuecomment-379575728, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhY_l85fG1nUxFWeDlN9lK5oIVMm06pks5tmmThgaJpZM4TLlzQ .

xXBlazeCraftXx commented 6 years ago

08.04 17:09:10 [Server] WARNING Event LoginEvent(cancelled=false, cancelReasonComponents=null, connection=[RedEnderPlayz] <-> InitialHandler) took 1,334,886,048ns to process! 08.04 17:09:35 [Server] INFO gcbu reloadcfg 08.04 17:09:35 [Server] SEVERE java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to java.lang.String 08.04 17:09:35 [Server] SEVERE at io.github.xxyy.cmdblocker.common.config.CBUConfig.resolveAliases(CBUConfig.java:158) 08.04 17:09:35 [Server] SEVERE at io.github.xxyy.cmdblocker.bungee.CommandBlockerPlugin.replaceConfigAdapter(CommandBlockerPlugin.java:177) 08.04 17:09:35 [Server] SEVERE at io.github.xxyy.cmdblocker.bungee.command.CommandGCBU.handleReloadConfig(CommandGCBU.java:65) 08.04 17:09:35 [Server] SEVERE at io.github.xxyy.cmdblocker.bungee.command.CommandGCBU.execute(CommandGCBU.java:52) 08.04 17:09:35 [Server] SEVERE at net.md_5.bungee.api.plugin.PluginManager.dispatchCommand(PluginManager.java:169) 08.04 17:09:35 [Server] SEVERE at net.md_5.bungee.api.plugin.PluginManager.dispatchCommand(PluginManager.java:116) 08.04 17:09:35 [Server] SEVERE at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:63) 08.04 17:09:35 [Server] SEVERE at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15) 08.04 17:09:35 [Server] INFO Your configuration file is invalid! See the server log for more details.Maybe http://yaml-online-parser.appspot.com/ can help you diagnose your issue.If not, you can get help at https://github.com/xxyy/commandblockerultimate/issues 08.04 17:09:35 [Server] INFO To protect your server from breaking, we have restored your previous configuration for the time being - It will be lost if you restart or reload your server. Execute this command again if you think you've fixed your config file. 08.04 17:09:35 [Server] INFO Check the FAQ at https://github.com/xxyy/commandblockerultimate/wiki/Frequently-Asked-Questions for some common problems.

I'm literally using the default config with a single addition which was

literalplus commented 6 years ago

The config you pasted has more additions, namely the /calc command with different arguments. (under target-commands)

It appears that those are causing the issue. The issue is that in target-commands, there are supposed to be only command names, but the plugin is misinterpreting something (probably your /calc lines) for something else. Try removing these.

If you are really using the default with only minecraft added, I'm not sure what is causing the issue. Please double-check that your config file is really clean and restart the server if possible. (Maybe some stale data got stuck in the system?)

On Sun, 8 Apr 2018, 23:10 xXBlazeCraftXx, notifications@github.com wrote:

08.04 17:09:10 [Server] WARNING Event LoginEvent(cancelled=false, cancelReasonComponents=null, connection=[RedEnderPlayz] <-> InitialHandler) took 1,334,886,048ns to process! 08.04 17:09:35 [Server] INFO gcbu reloadcfg 08.04 17:09:35 [Server] SEVERE java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to java.lang.String 08.04 17:09:35 [Server] SEVERE at io.github.xxyy.cmdblocker.common.config.CBUConfig.resolveAliases(CBUConfig.java:158) 08.04 17:09:35 [Server] SEVERE at io.github.xxyy.cmdblocker.bungee.CommandBlockerPlugin.replaceConfigAdapter(CommandBlockerPlugin.java:177) 08.04 17:09:35 [Server] SEVERE at io.github.xxyy.cmdblocker.bungee.command.CommandGCBU.handleReloadConfig(CommandGCBU.java:65) 08.04 17:09:35 [Server] SEVERE at io.github.xxyy.cmdblocker.bungee.command.CommandGCBU.execute(CommandGCBU.java:52) 08.04 17:09:35 [Server] SEVERE at net.md_5.bungee.api.plugin.PluginManager.dispatchCommand(PluginManager.java:169) 08.04 17:09:35 [Server] SEVERE at net.md_5.bungee.api.plugin.PluginManager.dispatchCommand(PluginManager.java:116) 08.04 17:09:35 [Server] SEVERE at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:63) 08.04 17:09:35 [Server] SEVERE at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15) 08.04 17:09:35 [Server] INFO Your configuration file is invalid! See the server log for more details.Maybe http://yaml-online-parser.appspot.com/ can help you diagnose your issue.If not, you can get help at https://github.com/xxyy/commandblockerultimate/issues 08.04 17:09:35 [Server] INFO To protect your server from breaking, we have restored your previous configuration for the time being - It will be lost if you restart or reload your server. Execute this command again if you think you've fixed your config file. 08.04 17:09:35 [Server] INFO Check the FAQ at https://github.com/xxyy/commandblockerultimate/wiki/Frequently-Asked-Questions for some common problems.

I'm literally using the default config with a single addition which was

  • minecraft

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/xxyy/commandblockerultimate/issues/45#issuecomment-379582890, or mute the thread https://github.com/notifications/unsubscribe-auth/AAhY_grnShc7bPZwwLoI6Bv0ppcAavn9ks5tmny9gaJpZM4TLlzQ .

literalplus commented 6 years ago

Just following up here: Do you still need assistance with this issue?

Another thing you could try that I missed before is deleting the config file altogether. The plugin should generate a fresh one for you on the next restart. You can then verify that the config has been generated, and restart the server again without making any modifications to the config file. If it doesn't error, you can change what you need one-by-one to find out what is causing the error.

Also, looking at the error message more closely, the initial issue didn't seem to be invalid YAML, but instead invalid meaning. (The plugin expected a command name, but the YAML had something very different)