Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LimboAuth still causing linkage errors #227

Closed
2 tasks done
rozhur opened this issue Aug 6, 2023 · 5 comments
Closed
2 tasks done

LimboAuth still causing linkage errors #227

rozhur opened this issue Aug 6, 2023 · 5 comments
Labels
incompatibility Other software is incompatible with this invalid Not related to this program

Comments

@rozhur
Copy link

rozhur commented Aug 6, 2023

LibertyBans Version

LibertyBans_Release-1.1.0-M3.jar

I have confirmed that ...

  • LibertyBans is up to date
  • No similar issue has been reported

Platform

Velocity

Description

i get spam errors:

Exception in thread "LibertyBansPool-MariaDB connection closer" java.lang.LinkageError: loader constraint violation: when resolving method 'int org.mariadb.jdbc.message.client.QuitPacket.encode(org.mariadb.jdbc.client.socket.Writer, org.mariadb.jdbc.client.Context)' the class loader 'LibertyBans-ClassLoader' @573ad692 of the current class, org/mariadb/jdbc/client/impl/StandardClient, and the class loader com.velocitypowered.proxy.plugin.PluginClassLoader @49cf9028 for the method's defining class, org/mariadb/jdbc/message/client/QuitPacket, have different Class objects for the type org/mariadb/jdbc/client/socket/Writer used in the signature (org.mariadb.jdbc.client.impl.StandardClient is in unnamed module of loader 'LibertyBans-ClassLoader' @573ad692, parent loader com.velocitypowered.proxy.plugin.PluginClassLoader @47ec7422; org.mariadb.jdbc.message.client.QuitPacket is in unnamed module of loader com.velocitypowered.proxy.plugin.PluginClassLoader @49cf9028, parent loader 'app')
[01:08:22 ERROR]:       at LibertyBans-ClassLoader//org.mariadb.jdbc.client.impl.StandardClient.close(StandardClient.java:986)
[01:08:22 ERROR]:       at LibertyBans-ClassLoader//org.mariadb.jdbc.Connection.close(Connection.java:235)
[01:08:22 ERROR]:       at LibertyBans-ClassLoader//com.zaxxer.hikari.pool.PoolBase.quietlyCloseConnection(PoolBase.java:137)
[01:08:22 ERROR]:       at LibertyBans-ClassLoader//com.zaxxer.hikari.pool.HikariPool.lambda$closeConnection$1(HikariPool.java:444)
[01:08:22 ERROR]:       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
[01:08:22 ERROR]:       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
[01:08:22 ERROR]:       at java.base/java.lang.Thread.run(Thread.java:833)

Velocity version: 3.2.0-SNAPSHOT
Database type: MariaDB

Configurations

config.yml

 # 
 # 
 # The main LibertyBans configuration
 # All options here can be updated with /libertybans reload
 # 
 # 
platforms:
  sponge:
     # Whether to register the ban service for use by other plugins.
     # If enabled, LibertyBans will replace the server's default banning implementation with its own.
     # 
     # This option is somewhat technical. For advice on whether you should configure this option,
     # please ask for support.
     # It is highly recommended to ask for guidance if you are unsure about this option.
     # 
     # How this affects compatibility:
     # - If disabled, the vanilla ban service will remain. Other plugins which query for bans will be
     #   served with information from vanilla. For example, if a player is banned through LibertyBans
     #   but not vanilla, then other plugins will think the player is not banned.
     # - If enabled, uses of the ban service will forward to LibertyBans. Other plugins which query for bans
     #   will be served with accurate information from LibertyBans.
     # - However, the LibertyBans ban service has limitations. It cannot issue bans, for example.
     #   So, if another plugin attempts to create bans using the ban service, you will receive an error.
     #   If you absolutely need other plugins to issue bans, you must disable this option.
     # 
     # Note that it is impossible to import vanilla bans if you enable this option. So, if you wish to import
     # from vanilla, first you need to disable this option. After importing, you may re-enable it.
    register-ban-service: true


 # Options related to punishment enforcement and alt account checking
 # 
 # -- Alt Account Enforcement and Checking --
 # There are multiple ways to combat alt accounts in LibertyBans.
 # 
 # First, you can have the plugin automatically detect alt accounts and prevent them from joining, 
 # with the same ban message. This is controlled by the 'address-strictness' setting.
 # 
 # Second, you can tell your staff members to be on the lookout for alts. They can use 
 # the /alts command to manually check players they suspect are alt accounts. Also, you can 
 # use the alts-auto-show feature which will automatically notify staff of players who may be using alts.
 # 
 # Third, you may use 'composite punishments', a more advanced feature which is described on the wiki.
enforcement:
   # Controls the expiration of join history as used by manual alt detection.
   # This allows expiring alt accounts after some time has elapsed.
   # 
   # This setting does NOT affect enforcement of IP-based punishments.
   # It applies only to the /alts command and the alts-auto-show feature.
   # 
   # Note that this feature will not actually delete any data from the database.
  alt-account-expiration:
     # Whether to enable this feature
    enable: false
     # The expiration time, in days.
    expiration-time-days: 30

   # 
   # How strict should IP-based punishments be?
   # Available options are LENIENT, NORMAL, STERN, and STRICT
   # 
   # An IP-based punishment applies to a player if:
   # LENIENT - The player's current address matches the punished address
   # NORMAL - Any of the player's past addresses matches the punished address
   # STERN - Any of the player's past addresses matches any of the past addresses of the punished user
   # 
   # STRICT is the same as STERN, but also enforces user punishments as stringently as IP-based punishments.
   #     (Using STRICT turns all user punishments into IP-based punishments)
  address-strictness: 'NORMAL'
   # 
   # A list of commands muted players will not be able to execute
   # 
   # This list supports subcommands, which will be enforced if the executed command starts with the list entry.
   # Additionally, colons in commands, such as"pluginname:cmd", cannot be used to bypass this.
  mute-commands:
    - 'msg'
    - 'r'
    - 't'
    - 'w'
    - 'tell'
    - 'me'
    - 'whisper'
    - 'say'
    - 'clan chat'
    - 'reply'
   # Runs an alt-check on newly joined players, as if by /alts, 
   # the results of which will be shown to staff members with the libertybans.alts.autoshow permission.
  alts-auto-show:
     # Set to true to enable this feature
    enable: false
     # Allows determining which alts will be shown by this alt-check
     # (This does not affect the alts command, which will always show all alts)
     # ALL_ALTS - shows all alts
     # BANNED_OR_MUTED_ALTS - shows alts either banned or muted
     # BANNED_ALTS - shows only banned alts
    show-which-alts: 'ALL_ALTS'

   # Limits players connecting from the same IP address.
   # 
   # The limiter works by counting the amount of joins from a given IP address within a recent timespan.
   # Thus, it is not an absolute limit, but a limit on the rate of joins.
  connection-limiter:
     # The limit to apply
    limit: 5
     # The message when a player is denied from joining due to the limit
    denial-message: 'There have been too many connections from your IP address recently'
     # Whether to enable this feature
    enable: false
     # What is the duration within which recent joins are counted against the limit?
     # The default is 30 minutes and the value is specified in seconds.
    duration-seconds: 1800


 # Options relating to finding UUIDs from names, and vice-versa
 # LibertyBans will first check its own caches before using these resources
player-uuid-resolution:
   # 
   # What kind of UUIDs do your players have?
   # Available options are ONLINE, OFFLINE, and MIXED
   # 
   # For most servers this will be 'ONLINE'
   # For offline servers where all players have offline UUIDs, use OFFLINE
   # For offline servers where some players have online and some have offline UUIDs, use MIXED
  server-type: 'OFFLINE'
   # 
   # As a last resort, when LibertyBans cannot find a uuid or name, it will use an external web API
   # Available options are 'MOJANG', 'ASHCON', and 'MCHEADS'. They will be queried sequentially in the order specified.
   # (If the server is not in ONLINE mode, this option is ignored)
  web-api-resolvers:
    - 'MOJANG'
   # By default, LibertyBans will automatically detect if you are running Geyser or Floodgate.
   # The prefix will be determined using the Geyser API
   # 
   # However, in rare cases, you may want to force LibertyBans to acknowledge the presence of Geyser usernames
   # If so, set this option to the value of the prefix you use for Geyser/Floodgate.
   # An empty string will revert this option to automatic detection, which requires a server restart to take effect.
  force-geyser-prefix: ''

 # Formatting of absolute dates
date-formatting:
   # Do you want to override the timezone? If 'default', the system default timezone is used
   # The value must be in continent/city format, such as 'America/New_York'. Uses Java's ZoneId.of
  timezone: 'Asia/Yekaterinburg'
   # How should dates be formatted? Follows Java's DateTimeFormatter.ofPattern
  format: 'dd/MM/yyyy kk:mm'

durationPermissions:
   # If disabled, players are not checked for duration permissions.
  enable: false
   # Which duration permissions should a staff member be checked for?
   # Specify all the durations which you want to explicitly grant permission for.
  permissions-to-check:
    - 'perm'
    - '4h'
    - '30d'
    - '10d'

 # Handles how staff are permitted to specify reasons
reasons:
   # Deprecated option kept for compatibility purposes. Ignore this.
  permit-blank: false
   # When entering commands, what happens if the staff member does not specify a reason?
   # USE_EMPTY_REASON - Keep the reason blank, as specified.
   # REQUIRE_REASON - Deny the command; send the usage message.
   # SUBSTITUTE_DEFAULT - Substitute the default reason.
  unspecified-reason-behavior: 'REQUIRE_REASON'
   # If unspecified-reason-behavior is SUBSTITUTE_DEFAULT, what is the default reason to use when staff do not specify a reason?
  default-reason: 'No reason stated.'

 # What language file should be used for messages?
 # For example, 'en' means LibertyBans will look for a file called 'messages_en.yml'
lang-file: 'ru'
commands:
   # What commands should be registered as aliases for libertybans commands?
   # For each command listed here, '/<command>' will be equal to '/libertybans <command>'
  aliases:
    - 'ban'
    - 'ipban'
    - 'mute'
    - 'ipmute'
    - 'warn'
    - 'ipwarn'
    - 'kick'
    - 'ipkick'
    - 'unban'
    - 'unbanip'
    - 'unmute'
    - 'unmuteip'
    - 'unwarn'
    - 'unwarnip'
    - 'banlist'
    - 'mutelist'
    - 'history'
    - 'warns'
    - 'blame'
    - 'alts'
    - 'accounthistory'
   # If this is enabled, it will be as if relevant commands used the -both argument.
   # Effectively, this makes punishments more strict, since moderators will end up banning UUIDs and addresses
  use-composite-victims-by-default: false
   # By default, /blame shows only active punishments made by a staff member.
   # If you disable this option, /blame will show all punishments, including those revoked and expired.
   # 
   # If you use the staffrollback addon, you probably want to disable this to make /blame consistent
   # with the staffrollback operation.
  blame-shows-active-only: true
   # By default, /history shows all active punishments for the player requested.
   # Enabling this option will make /history scan all punishments which would apply to the player
   # 
   # For example, an IP ban may apply to a player, but it will not be in the player's /history unless this is enabled
  show-applicable-for-history: false
   # Other options relating to tab completion
   # These settings require a restart (/libertybans restart) to take effect
  tab-completion:
     # Regards tab completing the names of players who have formerly joined
     # This can be a bit heavy on memory for large servers, so it's disabled by default.
     # To tune how long player names are retained for, see offline-player-names-retention-hours
    offline-player-names:
       # Whether to enable this feature
      enable: false
       # What is the period in which recently joining players' names should be completed
       # If a player has joined in the last specified amount of minutes, his or her name is tab-completed
      retention-minutes: 4320
       # This feature is implemented using a cache. How often should the cache be refreshed?
       # Shorter times mean more accurate tab completion but use slightly more performance
      cache-refresh-seconds: 120

     # This option is only relevant when LibertyBans is on a proxy
     # If enabled, tab completion of online player names will exclude the names of players
     # on different backend servers.
    use-only-players-on-same-server: true
     # Enables tab-completing punishment durations. For example, '30d' in '/ban A248 30d'
     # 
    punishment-durations:
       # Whether to enable this feature
      enable: false
       # Which duration permissions should be tab-completed?
       # Specify all the durations which you want to tab complete.
       # 
       # If duration permissions are enabled, only players who have permission to use a certain duration
       # will have that duration tab-completed.
      durations-to-supply:
        - 'perm'
        - '4h'
        - '30d'
        - '10d'


   # Whether to enable tab completion
  enable-tab-completion: true

sql.yml

 # 
 # SQL Database settings
 # 
 # For most servers, the default options here are perfect. Most users will not need to bother here.
 # 
 # However, for servers wishing to use an external database, or for large servers wishing to tweak performance,
 # further configuration is made here.
 # 
 # Database version requirements:
 # - MariaDB: Requires MariaDB 10.6 or newer.
 # - MySQL: Requires MySQL 8.0 or newer.
 # - PostgreSQL: Requires PostgreSQL 12 or newer.
 # - CockroachDB: Requires the latest version. Support for this database is experimental.
 # 
 # Older versions of these respective databases are not supported.
 # 
 # Information on character sets and encoding:
 # - MariaDB: UTF8 is configured automatically
 # - MySQL: UTF8 is configured automatically
 # - PostgreSQL: UTF8 is used for the client encoding. It may be necessary to configure the database collation to use UTF8.
 # - CockroachDB: This database uses UTF8 regardless.
 # 
 # Note well:
 # To apply changes made here, use '/libertybans restart' or restart the server.
 # Using '/libertybans reload' will NOT update your database settings!
 # 
 # 
 # 
 # Settings for synchronizing multiple LibertyBans instances.
synchronization:
   # Availalble synchronization options:
   # NONE - no synchronization
   # ANSI_SQL - uses your database to synchronize punishments (called ANSI_SQL because it uses standard SQL)
   # Other options may be added in the future, upon feature request.
  mode: 'NONE'
   # How frequently the database is polled for updates, in milliseconds.
   # Usually the default setting of 4 seconds will be sufficiently responsive without querying the database too often
   # If you want to increase responsiveness, lower this value. If you want to reduce database load, increase this value.
   # 
   # This value MUST be less than 30 seconds.
  poll-rate-millis: 4000

 # All punishments are stored fully in the database, with one exception.
 # Mutes are cached for a small period of time so that players' chatting does not 
 # flood your database with queries.
 # 
 # Note: It is likely you do not need to touch this.
mute-caching:
   # How the expiration time should be used. EXPIRE_AFTER_ACCESS is the default,
   # which means that a cached mute's expiration time will be reset each time it is used.
   # 
   # Set this to EXPIRE_AFTER_WRITE if there is any program or other instance of LibertyBans
   # which may modify mutes in the database outside of this instance of LibertyBans.
   # For example, if you are using a third-party tool which can delete or add mutes,
   # EXPIRE_AFTER_WRITE is the correct semantic.
   # 
   # If you are using multi-instance synchronization, this option is set automatically
   # and you do not need to configure it.
   # 
   # EXPIRE_AFTER_WRITE will expire the cached mute after a fixed time has elapsed
   # since the mute was fetched. With EXPIRE_AFTER_ACCESS, the expiration time
   # will refresh each time the mute is used.
  expiration-semantics: 'EXPIRE_AFTER_ACCESS'
   # How long it takes a mute to expire
  expiration-time-seconds: 20

 # 
 # How large should the connection pool be?
 # A thread pool of similar size is derived from the connection pool size.
 # For most servers, the default option is suitable.
connection-pool-size: 6
 # Authentication details for remote databases: used for MariaDB, MySQL, PostgreSQL, and CockroachDB.
auth-details:
  host: 'localhost'
  port: 3306
  password: 'passwd'
  user: 'usr'
  database: 'db'

 # The values in this section only apply when using a MariaDB or MySQL database
mariadb:
   # Connection properties to be applied to database connections
  connection-properties:
    useUnicode: 'true'
    prepStmtCacheSqlLimit: '1024'
    cachePrepStmts: 'true'
    characterEncoding: 'UTF-8'
    prepStmtCacheSize: '25'
    useServerPrepStmts: 'true'


 # The values in this section only apply when using a PostgreSQL or CockroachDB database
postgres:
   # Connection properties to be applied to database connections
  connection-properties:
    preparedStatementCacheQueries: '25'


 # Legacy option. Don't touch this unless you understand it or you're told to enable it.
use-traditional-jdbc-url: false
 # What RDMS vendor will you be using?
 # Available options:
 # 'HSQLDB' - Local HyperSQL database. No additional requirements.
 # 'MARIADB' - Requires an external MariaDB database. At least MariaDB 10.6 is required.
 # 'MYSQL' - Requires an external MySQL database. At least MySQL 8.0 is required.
 # 'POSTGRES' - Requires an external PostgreSQL database. At least PostgreSQL 12 is required.
 # 'COCKROACH' - Requires an external CockroachDB database. The latest CockroachDB is required. Warning: this option is strictly experimental.
rdms-vendor: 'MARIADB'
 # 
 # Connection timeout settings
 # LibertyBans uses HikariCP for connection pooling. The following settings control connection timeouts.
timeouts:
   # How long, at maximum, should LibertyBans wait when acquiring new connections, if no existing connection is available?
  connection-timeout-seconds: 14
   # How long, at maxium, should a connection in the pool last before having to be recreated?
   # "This value should be set for MariaDB or MySQL. HikariCP notes:
   # "It should be several seconds shorter than any database or infrastructure imposed connection time limit"
  max-lifetime-minutes: 25

Plugins: `LimboAPI, LimboAuth, LuckPerms, ServerUtils`
@rozhur rozhur added the bug Interferes with efficient operation label Aug 6, 2023
@A248
Copy link
Owner

A248 commented Aug 7, 2023

Please go tell LimboAuth to fix the error. It's their bug. We already reported it to them a week ago, and it is an easy fix.

Elytrium/LimboAuth#113

@A248 A248 closed this as not planned Won't fix, can't repro, duplicate, stale Aug 7, 2023
@A248 A248 changed the title [Bug Report]: java.lang.LinkageError LimboAuth still causing linkage errors Aug 7, 2023
@A248 A248 added invalid Not related to this program incompatibility Other software is incompatible with this and removed bug Interferes with efficient operation labels Aug 7, 2023
@rozhur
Copy link
Author

rozhur commented Aug 7, 2023

Limboauth uses Velocity's mariadb driver library (*velocity-root*/libraries/org/mariadb/jdbc/mariadb-java-client/3.1.4/mariadb-java-client-3.1.4.jar). You duplicate the library in *libertybans-root*/internal/libraries/space.arim.libertybans.bans-download_1.1.0-M3.jar and don't relocate

@4drian3d
Copy link
Contributor

4drian3d commented Aug 7, 2023

Limboauth uses Velocity's mariadb driver library (*velocity-root*/libraries/org/mariadb/jdbc/mariadb-java-client/3.1.4/mariadb-java-client-3.1.4.jar). You duplicate the library in *libertybans-root*/internal/libraries/space.arim.libertybans.bans-download_1.1.0-M3.jar and don't relocate

Velocity does not include any database drivers

@A248
Copy link
Owner

A248 commented Aug 7, 2023

Limboauth uses Velocity's mariadb driver library (*velocity-root*/libraries/org/mariadb/jdbc/mariadb-java-client/3.1.4/mariadb-java-client-3.1.4.jar). You duplicate the library in *libertybans-root*/internal/libraries/space.arim.libertybans.bans-download_1.1.0-M3.jar and don't relocate

I'm not required to relocate -- LibertyBans uses an isolated classloader, so other plugins don't see our dependencies.

Velocity does not include the MariaDB driver. That library is added dynamically to the classpath by LimboAuth. The bug is fully explained in the linked LimboAuth issue. Please have them fix it.

@rozhur
Copy link
Author

rozhur commented Aug 7, 2023

When I saw the limboauth code, I realized that they create a folder with libraries in the velocity root and load the libraries there directly from the maven central. I was also confused by your lack of relocation, but you explained about the isolated class loader, and I have no more questions for you.

It looks like the developer of limboauth should also isolate the classloader, because this library is not included directly in .jar, it is loaded from the repository, then relocation will be difficult.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incompatibility Other software is incompatible with this invalid Not related to this program
Projects
None yet
Development

No branches or pull requests

3 participants