Skip to Content Skip to Menu

šŸŒ² Merry Christmas! Great savings on Professional and Developer Memberships! Get 25% off now with codeĀ XMAS-2024!

SQL error on site logout

  • ah202
  • ah202
  • OFFLINE
  • Posts: 6
  • Thanks: 1
  • Karma: 0
9 years 11 months ago #257166 by ah202
SQL error on site logout was created by ah202
Hi,

I have installed Community builder to interact with another plugin (Joomdle) that exports user Data onto another website upon registration in Joomla.

I have added the CB login module onto my site homepage, and removed the default Joomla login form module.

I am experiencing an issue when logging out of the site. When any user logs out more than once in the same session taken to the following page:

/index.php/cb-logout/logout

An SQL database error is then displayed on the page as below, the rest of the page is blank:

Duplicate entry '' for key 'PRIMARY' SQL=INSERT INTO `jos_session` (`session_id`, `client_id`, `guest`, `time`, `userid`, `username`) VALUES ('', 0, 1, '0', 0, '')

The issue resolves itself once I disable the CB plugin and re-enable the default login form.

I have done some investigation into this and can see that the 'Jos_session' table in the Joomla database appears to not be cleared down properly after the first logout, Leaving a row with a blank session ID. I have attached the contents of Jos_session after login for the first time and after the second time for comparison.


I am running

Joomla 3.3.6 stable
CB 2.0.4
PHP 5.4.34
MYSQL 5.1

If you need anything else to help troubleshoot let me know.

Can you advise on how I can resolve this issue? Thanks.
Attachments:

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48622
  • Thanks: 8303
  • Karma: 1446
9 years 11 months ago - 9 years 11 months ago #257204 by krileon
Replied by krileon on topic SQL error on site logout
Empty your _session table then see if issue comes up again. I've no idea why something is trying to manually insert a session row. CB doesn't do any inserts directly to _session. We use Joomla session API directly. On logout CB clears the session and resets is the same way Joomla does, which re-establishes a guest session on logout. No session should have an empty key. My guess is whatever you're using to interact between CB and Joomdle is likely causing this; especially if it's trying to do some behavior on login/logout.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
Last edit: 9 years 11 months ago by krileon.

Please Log in or Create an account to join the conversation.

  • ah202
  • ah202
  • OFFLINE
  • Posts: 6
  • Thanks: 1
  • Karma: 0
9 years 11 months ago - 9 years 11 months ago #257214 by ah202
Replied by ah202 on topic SQL error on site logout
Hi,

Sorry I should have mentioned this in the original reply but i've already cleared the jos_session table by truncating the table, this stops the error occuring on the next logout, but the issue then re-appears.

I have the query log for login/logout, I can see the offending SQL:

FROM `jos_session`
WHERE `session_id` = '' LIMIT 0, 1
74 Query INSERTĀ INTO `jos_session`
(`session_id`, `client_id`, `time`) VALUES
('', 0, '1417444365')
74 Query UPDATEĀ `jos_session`
SET `data` = '__default|a:2:{s:22:\"session.client.browser\";s:108:\"Mozilla/5 .0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0. 2171.95 Safari/537.36\";s:15:\"session.counter\";i:1;}'
, `time` = '1417444365'


If this is not CB inserting this data then I'm not sure what is, as this issue disappears when I remove CB login, can you suggest how I might troubleshoot this further? Thanks

The full query log for the logout operation is attached.
Attachments:
Last edit: 9 years 11 months ago by ah202.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48622
  • Thanks: 8303
  • Karma: 1446
9 years 11 months ago #257218 by krileon
Replied by krileon on topic SQL error on site logout
Your invalid insert is directly after the jmoodle extension has loaded. See the below.

Code:
74 Query SELECT extension_id AS id, element AS "option" , params, enabled FROM jos_extensions WHERE `type` = 'component' AND `element` = 'com_joomdle' 74 Query SELECT `data` FROM `jos_session` WHERE `session_id` = '' 74 Query SELECT `session_id` FROM `jos_session` WHERE `session_id` = '' LIMIT 0, 1 74 Query INSERT INTO `jos_session` (`session_id`, `client_id`, `time`) VALUES ('', 0, '1417444365')

jmoodle is loading, then querying for a session with no session id, then inserting one. My guess it's a part of jmoodle behavior. Disable jmoodle extension, empty your session table, then retest to see if the issue persists.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: nant

Please Log in or Create an account to join the conversation.

  • ah202
  • ah202
  • OFFLINE
  • Posts: 6
  • Thanks: 1
  • Karma: 0
9 years 11 months ago #257284 by ah202
Replied by ah202 on topic SQL error on site logout
Hi Kyle, Thanks for finding that. Disabling Joomdle does indeed fix this issue. I will raise it with the Joomdle devs to see if they can do anything to fix this.
The following user(s) said Thank You: krileon

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum