MyBB Community Forums

Full Version: SQL Error: 1062 - Duplicate entry 'bot=1' for key 'PRIMARY'
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

I have following error log entry:

	<dateline>1541571669</dateline>
	<script></script>
	<line>0</line>
	<type>20</type>
	<friendly_type>MyBB SQL Error</friendly_type>
	<message>SQL Error: 1062 - Duplicate entry 'bot=1' for key 'PRIMARY'
Query: REPLACE INTO mybb_sessions SET `sid`='bot=1',`time`=1541571669,`ip`=X'42f94506',`location`='/forum/index.php?',`useragent`='Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)',`location1`=0,`location2`=0,`nopermission`=0</message>
</error>

The first time this occours wars in May, I assume it was after an update.  But I discovered it a short time ago. Google Search console had banned us from the index, because they became an error Page, but the forum was fine for every one else. I updated from 1.8.15 to 1.8.19 but that changed nothing.

truncating the mybb_sessions table solved the symtoms. Google could crawl again. But next day the error was back in the log.
There was a similar bug 10 Years ago https://community.mybb.com/archive/index...38222.html
where an insert into got replaced by an replace.

Has someone an idea how to solve this?

Google is listet in the "who is online" Panel, but /forum/admin/index.php?module=config-spiders says google was never here before. Last visit: never.