Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

Bug, Truncated string on params in a group with thousands of users joined

2 years 9 months ago
Licenses:
JomSocial Active GURU Active Publisher Active AdAgency Active iSEO Active Socialize Active

Hi I detect a new bug on jomsocial. The problem is in the rows inserted into community_activities table, when a user join to a jomsocial group the system insert a row like this:

INSERT INTO `xxxxx_community_activities` (`id`, `actor`, `target`, `title`, `content`, `app`, `verb`, `cid`, `groupid`, `eventid`, `group_access`, `event_access`, `created`, `access`, `params`, `points`, `archived`, `location`, `latitude`, `longitude`, `comment_id`, `comment_type`, `like_id`, `like_type`, `actors`, `updated_at`) VALUES
(136665, 0, 0, '', '', 'groups.join', '', 204, 204, 0, 0, 0, '2016-10-28 20:14:06', 0, '{"group_url":"index.php?option=com_community&view=groups&task=viewgroup&groupid=204","action":"group.join","actors":"960971,584601,62,285864,772171,551212,628773,785552,785828,785839,786109,1203,244097,782551,425572,450251,787800,585904,663852,598236,648010,676022,702797,734305,788472,645455,709337,347975,788608,658048,523285,788649,461959"}', 1, 0, '', 255, 255, 0, '', 0, '', '{"userid":[{"id":"1265693"},{"id":"1265713"},{"id":"33826"},{"id":"1265741"},{"id":"1265846"},{"id":"1045138"},{"id":"1265849"},{"id":"1266107"},{"id":"237015"},{"id":"1115460"},{"id":"681574"},{"id":"1081893"},{"id":"1266328"},{"id":"407637"},{"id":"1266373"},{"id":"1266863"},{"id":"1266973"},{"id":"1267340"},{"id":"1267454"},{"id":"1267520"},{"id":"1255733"},{"id":"1267594"},{"id":"1267383"},{"id":"1267706"},{"id":"671832"},{"id":"1268076"},{"id":"1268255"}]}', '2016-10-28 20:14:06');

And it don’t have any problems but when a group have a big number of users jomsocial insert a truncated string on params (I think that the database don’t permit the amount of characters), it value is similar than this (I attach the real row):

'{"group_url":"index.php?option=com_community&view=groups&task=viewgroup&groupid=204","action":"group.join","actors":"960971,584601,62,285864,772171,551212,628773,785552,785828,785839,786109,1203,244097,782551,425572,450251,787800,585904,663852,598236,648010,676022,702797,734305…hundreds of numbers…,461959'

As you can see the value is truncated because params must end with “} characters and this row will generate a problem in all pages that show activity stream (at least jomsocial home and the group home) this pages will give this error “ERROR DECODING JSON DATA: CONTROL CHARACTER ERROR, POSSIBLY INCORRECTLY ENCODED”. I think that the problem is that jomsocial does not restrict the date from which the actors appear on “{actor} and other {actors} have joined to {groupname} group” and jomsocial really put on “other {actors}” all previously joined users and it is a big error because sooner or later it will fail. You have 2 option to solve it, first one limit the date to a week or a month, the second option is to store only the actor count instead its ids, if you do this second option you can’t show the actors in the modal window but I think that this is not a very useful function and I think that will increase the speed.

I took two days to locate the error and I hope that you can solve it as soon as possible because is a really big problem for me.

This message has an attachment file.
Please log in or register to see it.

2 years 8 months ago
Licenses:

Hi, Aitor.

Thank you for contacting us and pointing this out.
I assign developer to investigate this further.
He'll contact you ASAP.


- Instead of saying: 'it's not working', explain the problem in detail.
- Screenshots with the URL visible in them and the problem marked are more than welcome.
- Tell us how to replicate the problem, we can't fix it if we can't find it.
- Make sure that your site/server meets JomSocial System Requirements
- Make sure to setup JomSocial Cron Job
- Always provide us with access details to the backend and ftp. We need it to debug problems.
- If you have a similar problem, but a solution you found isn't working, open a new thread instead of 'merging' with an existing one.

- Use the "Thank You" feature on any post that helped you
The following user(s) said Thank You: Aitor Calvo
2 years 8 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

Hi Aitor,

can you provide me the steps to replicate this issue on your server, please?
also please you check your table #__community_activties, and the field type this field "params" is "text".

thank you!

2 years 8 months ago
Licenses:
JomSocial Active GURU Active Publisher Active AdAgency Active iSEO Active Socialize Active

You only need to join to this group www.manualesdemecanica.com/social-networ...aller-de-coches.html (I delete all activities to prevent the problem)

Yes, params is a text field but is very simple:
user joined: 13.827
Characters of a single id: minimun 5
Bytes needed to code an UTF8 characters: 3 bytes
Number of bytes needed to store: 13.827 x 5 x 3 = 207.405 bytes
Maximun number of bytes that a text field can store: 65,535 bytes

Result, is imposible to store this amount of characters.

2 years 8 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

hi Aitor,

OK, would you mind provide me phpmyadmin access, please? I will test your database it on my local

thank you!

2 years 8 months ago
Licenses:
JomSocial Active GURU Active Publisher Active AdAgency Active iSEO Active Socialize Active

Hi Dimas,

You have my database (I send it 2 years ago), you only need to add users massively ( at least 12.000) to a group from phpmyadmin and after that join one user to the group from frontend. To get the error you need to install at least Joomla 3.6.3 that have this new verification, in previus version the string is also truncated but joomla don't display the error.

Is very dificult for me give you the access to phpmyadmin because it is only accessible from Plesk Panel. I don't understand why you need it the error is very simple and completely logical never may be a good option add ALL previously joined users ids to a field, it is a big error because sooner or later it will fail and it will slow down the database always.

2 years 8 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

Hi Aitor,

I am sorry for delay answer, I wanna to fix this issue directly from database, try again to make this issue error and then find the solution when trigger join group.. so thats why I need your phpmyadmin access.. :)

thank you!

2 years 8 months ago
Licenses:
JomSocial Active GURU Active Publisher Active AdAgency Active iSEO Active Socialize Active

Dimas, I am not a beginner I can correct the problem altering the table field TEXT to LONGTEXT but is not a real solution. The problem is how does jomsocial works, jomsocial can not add ALL joined users ids to a field, is not optimized, do you understand what happens in my DB when a user clic on the text "and 13.892 others have joined..." (in activities stream) the system try to SELECT 13.892 users and show them, the select don't take seconds take minutes and is a very simple option to do a DDOS attack... Yes I can hack the message to not show the link but let's be serious... Do you think it's right to do things like that?

2 years 8 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

hi,

I will discuss this with our lead developer.

thank you

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW