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

[BUG]: Int too small for AgentStatsId #1047

Open
zyronix opened this issue Mar 11, 2024 · 0 comments
Open

[BUG]: Int too small for AgentStatsId #1047

zyronix opened this issue Mar 11, 2024 · 0 comments
Labels
bug Something isn't working server Hashtopolis API/Server related

Comments

@zyronix
Copy link
Member

zyronix commented Mar 11, 2024

Version Information

0.14.1

Hashcat

No response

Description

In case of a long running hashtopolis environment, you can run into the int being too small for storing ids of some of the stats or logging entries.

As an example, this will result in something like this, an agent trying to submit progress:

[php:error] [pid 31340] PHP Fatal error:  Uncaught PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2147483647' for key 'AgentStat.PRIMARY' inAbstractModelFactory.class.php:115

Stack trace:
#0 hashtopolis/dba/AbstractModelFactory.class.php(115): PDOStatement->execute()
#1 hashtopolis/dba/models/AgentStatFactory.class.php(80): DBA\\AbstractModelFactory->save()
#2 hashtopolis/inc/api/APISendProgress.class.php(99): DBA\\AgentStatFactory->save()
#3 hashtopolis/api/server.php(141): APISendProgress->execute()
#4 {main}
thrown in hashtopolis/dba/AbstractModelFactory.class.php on line 115

This is because the key is created as a int(11). Simple fix for this is:

ALTER TABLE AgentStat MODIFY agentStatId BIGINT AUTO_INCREMENT;

@s3inlc there are multiple solutions

  1. we could increase the INT to BIGINT for just AgentStat
  2. we could increase them for all stat/log tables (Speed, AgentStat, Log, maybe others?)
  3. we could increase all ints to 64 int by default

Any preference?

@zyronix zyronix added bug Something isn't working server Hashtopolis API/Server related labels Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working server Hashtopolis API/Server related
Projects
Status: No status
Development

No branches or pull requests

1 participant