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

Login: SQLSTATE[HY000]: General error: 1 no such column: criteria667bbee641d33 #194

Closed
adiba opened this issue Jun 26, 2024 · 10 comments
Closed

Comments

@adiba
Copy link

adiba commented Jun 26, 2024

When trying to log in (with $debug=true), I receive an error toast:

SQLSTATE[HY000]: General error: 1 no such column: criteria667bbee641d33

the HEX string after 'criteria' changes, but always starts with 667.

My cockpit v2.3.0 installation worked fine on the same system for a year until this week. I didn't even change anything in code, data, or configuration.
I also tried to re-install - same problem.

Any ideas how I can debug this further and track down the problem?

@aheinze
Copy link
Collaborator

aheinze commented Jun 28, 2024

Hey 👋

Hard to tell what is wrong here. Did anything changed with your infra setup (php version etc?)

@adiba
Copy link
Author

adiba commented Jun 29, 2024

Hey 👋

Hard to tell what is wrong here. Did anything changed with your infra setup (php version etc?)

Thank you for your reply :)

I did not change anything and apparently my hosting provider did not change anything either.
The PHP version has been 8.1 since day 1.

@Orygaw
Copy link

Orygaw commented Jul 24, 2024

Hello, i have the same error. I am using sqlite 3.46.0. I noticed that when I edit the code, the connections look correct:
lib/MongoLite/Cursor.php

$sql[] = 'WHERE document_criteria("'.$this->criteria.'", document)';
Change to:

$sql[] = 'WHERE document_criteria(\''.$this->criteria.'\', document)';

Is it a matter of sqlite itself or Cockpit? The error started appearing recently. I am unable to install the new version of Cockpit.

@aheinze
Copy link
Collaborator

aheinze commented Jul 24, 2024

Cockpit requires PHP 8.2. Can you confirm that you use PHP >= 8.2?

@Munrok
Copy link

Munrok commented Jul 25, 2024

This is not a PHP issue. The SQLite developers have been announcing the change for years, but the Cockpit developers missed it. It is explained here: https://sqlite.org/quirks.html#double_quoted_string_literals_are_accepted.

@aheinze
Copy link
Collaborator

aheinze commented Jul 30, 2024

Thank you for the hint 👍 Fix will be available in the next release!

@aheinze aheinze closed this as completed Jul 30, 2024
@pshemek
Copy link

pshemek commented Sep 3, 2024

Hi @aheinze, it seems that the fix should be applied here as well:

COCKPIT[ERROR]: SQLSTATE[HY000]: General error: 1 no such column: "criteria66d71829062f3" - should this be a string literal in single-quotes? @/lib/MongoLite/Collection.php:146

$sql = 'SELECT id, document FROM'.$this->name.' WHERE document_criteria("'.$this->database->registerCriteriaFunction($criteria).'", document)';

I hope no other places left.

@aheinze
Copy link
Collaborator

aheinze commented Sep 4, 2024

Hi @aheinze, it seems that the fix should be applied here as well:

COCKPIT[ERROR]: SQLSTATE[HY000]: General error: 1 no such column: "criteria66d71829062f3" - should this be a string literal in single-quotes? @/lib/MongoLite/Collection.php:146

$sql = 'SELECT id, document FROM'.$this->name.' WHERE document_criteria("'.$this->database->registerCriteriaFunction($criteria).'", document)';

I hope no other places left.

Thank you for reporting!

@pshemek
Copy link

pshemek commented Sep 16, 2024

In @/lib/MongoLite/Cursor.php

$sql[] = 'WHERE document_criteria("'.$this->criteria.'", document)';

into

$sql[] = "WHERE document_criteria('{$this->criteria}', document)";

as well.

@aheinze
Copy link
Collaborator

aheinze commented Sep 16, 2024

@pshemek this should already be fixed in the current dev codebase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants