News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

The database value you're trying to insert does not exist: id_theme

Started by jacbier, July 25, 2022, 10:24:39 AM

Previous topic - Next topic

jacbier

The forum Hobbybrouwen.nl is an SMF forum. It worked without any problems until this morning. From one moment to the next it was no longer possible to log in. There have been no changes to the forum lately.
After restoring a backup from yesterday by the hoster I get the message The database value you're trying to insert does not exist: id_theme".
Are you aware of a solution to this problem?

By the way, I had a similar error message a few months ago after upgrading to SMF 2.1.0. These were resolved by a forum member who hasn't visited the forum for quite some time now.
The current SMF version is 2.1.2.

Doug Heffernan

Quote from: jacbier on July 25, 2022, 10:24:39 AMThe forum Hobbybrouwen.nl is an SMF forum. It worked without any problems until this morning. From one moment to the next it was no longer possible to log in. There have been no changes to the forum lately.
After restoring a backup from yesterday by the hoster I get the message The database value you're trying to insert does not exist: id_theme".
Are you aware of a solution to this problem?

By the way, I had a similar error message a few months ago after upgrading to SMF 2.1.0. These were resolved by a forum member who hasn't visited the forum for quite some time now.
The current SMF version is 2.1.2.

Can you check the themes table in the database and see it it contains the id_theme field?

For future refernece, whenever you run into issues, it is beter to first see if they can be solved, before restoring the backup.

Arantor

That's not what the error means, though. That means there is a query that uses {int:id_theme} as a placeholder but is never given an actual value by the code.

We'd need to know where the error is occurring, from the error log, to help work on this.

Kindred

In addition to the actual error --- when you restored a backup, did you restore the database AND files?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

jacbier

Quote from: Kindred on July 25, 2022, 12:32:45 PMIn addition to the actual error --- when you restored a backup, did you restore the database AND files?

Yes both.

Quote from: Arantor on July 25, 2022, 11:46:13 AMThat's not what the error means, though. That means there is a query that uses {int:id_theme} as a placeholder but is never given an actual value by the code.

We'd need to know where the error is occurring, from the error log, to help work on this.

I looked through phpMyAdmin (looking for the error log). The backup restored by the hoster is not complete. I asked to restore a full backup that I made myself. The database is so big that I can't do this myself.

If all goes well, the forum will be available again. But probably the problem of not being able to login will still exist...

Hopefully the hoster will restore the backup tomorrow.

Arantor

The error log is in smf_log_errors but if you restored a backup you might have overwritten the log...

jacbier

The host has restored an old backup. For a moment it seemed that everything was working again. This was short-lived. It went wrong again.
I (and other members) can't log in. The registration screen does work.

In log_errors I see
?action=login2;ajax Password incorrect - <span class="remove">Blokkie</span> *********** user

[{"file":"\**********\/forum\/index.php","line":191,"function":"Login2"}]

Doug Heffernan

Quote from: jacbier on July 26, 2022, 04:06:46 PMIn log_errors I see
?action=login2;ajax Password incorrect - <span class="remove">Blokkie</span>

Stating the obvious, are you really sure that you entered the correct password?

Additionally, have a look at this post and give the suggestions mentioned there a try.

https://www.simplemachines.org/community/index.php?topic=581338.msg4115422#msg4115422

Kindred

Please post the actual error without  changing anything....      because what you posted suggests that you have a major problem in your template ---  but I suspect it's because you changed too much and broke the paste
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

jacbier

Quote from: Kindred on July 26, 2022, 04:41:43 PMPlease post the actual error without  changing anything....      because what you posted suggests that you have a major problem in your template ---  but I suspect it's because you changed too much and broke the paste

What is left out is the server address and a very long string of numbers.

jacbier

Something is structurally wrong. Suddenly I couldn't log in anymore. After clicking on the login button, a small window appears with a rotating circle and nothing else happens.
Members have reported via email that they can enter their login details once. Then they are logged out and login is no longer possible because the small window with the rotating circle appears afterwards.
You cannot view this attachment.

Kindred

If the error message includes that html in the actual message, then that suggests a broken template
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

jacbier

Quote from: Kindred on July 27, 2022, 06:19:29 AMIf the error message includes that html in the actual message, then that suggests a broken template

The message
"The database value you're trying to insert does not exist: id_theme".
disappeared after restoring from an old backup.


The forum seemed functional. I was able to log in but was immediately logged out. After that it is no longer possible to log in. It seems that the login script hangs.
Could this be the work of hackers?

Kindred

unlikely to be hackers... especially if the restore made it work.

Can you please set up a temp admin account and PM me the information (site url, username, password) so I can take a look?
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

SpacePhoenix

Ask your host if there's been any changes made to either the versions or configuration of MySQL and PHP

Kindred

right....   so something is very, very wrong with this forum.

I'll continue looking into it as indicated in PM.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Kindred

jeez louise...

I should have known to check this first thing and saved an hour or so of debugging...

for anyone in the future having issues with inability to login or anything else that seems to be reloading the index page, ignoring your actions ----  TURN OFF VARNISH

VARNISH IS A CACODAEMON!
Kill it. Kill it with fire. Nuke it from orbit. It's the only way to be sure.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

You should only be turning off Varnish if you don't have the ability to configure it. If you can get at the configuration, better to block out the parts you don't want cached.

Kindred

Thanks Arantor...

@jacbier -- see what Arantor said.  If you can work with your host to CONFIGURE Varnish correctly, it can be turned back on....   but at least we now know the cause.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

jacbier

Quote from: Kindred on July 28, 2022, 10:13:37 AMThanks Arantor...

@jacbier -- see what Arantor said.  If you can work with your host to CONFIGURE Varnish correctly, it can be turned back on....   but at least we now know the cause.

I am not satisfied with my host. The service is bad.

Again many thanks for your help. That Vanish could have such a big impact on the functioning of the forum is something I didn't realize. Could have saved me many hours of frustration.

Advertisement: