Hello,
I'm getting an error when running the ?option=community&task=cron from the browser...
<b>Warning</b>: Invalid argument supplied for foreach() in <b>/home/XXXXXXXXXX/public_html/components/com_community/libraries/cron.php</b> on line <b>853</b><br />
^
I did see one other thread like this where the user created his own missing folder to take care of the problem. I have also done that with no success. However, I'm not sure if he was using Amazon S3, and I am.
I did do some testing and was able to successfully create a new Group and upload the Cover image, run cron, and the system stored the image in S3. But, if I tried any other upload that should go to S3, like changing/uploading a Group Avatar, it is stored locally on the Server and S3 is bypassed, and the Cron Error occurs.
I would appreciate your help in resolving.
Thanks,
Brian
Hi, Brian.
You need to post a domain change request first.
Please post a request here:
www.jomsocial.com/forum/billing-issues
And provide reason for change.
When your request will be accepted, please, update this thread that it's done.
Then I'll proceed with support.
Hi, Brian.
Make sure that you have latest FFMPEG version installed (ask you hosting provider about it).
Then try this solution:
www.jomsocial.com/forum/profile-universa...ed-for-foreach#85613
I have already tried the solution posted, and mentioned the results in the first thread.
I do have root server access and checked the ffmpeg version = 0.6.5 running on Centos = 6.6
Something appears to be out of sync with JomSocial trying to create/copy/delete either Group Avatars or Cover images, to AWS S3.
I will test again by using a New User (so we get new ID's), then will create new Group, and modify Avatar image - then fire off cron.
Okay, I implemented the following code change to /home/XXXXXXXXXX/public_html/components/com_community/libraries/cron.php
$pCover = JFolder::folders($path . '/' . $folder . '/profile');
if($pCover) {
foreach ($pCover as $_pCoverId) {
...}}
Hi, Brian.
Then you have REALLY old version of FFMPEG. Latest version is 2.5.1.
Please, try to upgrade it.
Hey Michael,
I see the same 2.5.1 on the home page. But, if you look a bit deeper you will find the latest ffmpeg version, for RHEL/Centos 6.X 64-bit = 0.10.15 ...so I'm not that far off.
http://download1.rpmfusion.org/free/el/updates/6/x86_64/repoview/index.html
Anyway, upgrading ffmpeg doesn't seem to be the issue at the moment. The cron fails at 2 points...
1) Something was out of Sync upon creating either a User or Group Avatar and/or Cover image...this threw
...Error Cron : Invalid argument supplied for foreach() at line
...modified cron.php to include the test for : if($pCover)
2) When I deleted the User or Group from JomSocial backend, then ran the cron, it threw:
....Warning: S3::deleteObject(): [BucketNotEmpty] The bucket you tried to delete is not empty in /home/XXXXXXX/public_html/components/com_community/libraries/storage/s3_lib.php on line 337
...which is strange, because the error is correct the bucket is not empty...I deleted the User/Group and expected the cron to Delete the files from S3 - not warn me otherwise.
Can we find a new starting point for testing and walk through this to eliminate the cron errors and the fact that JomSocial is creating duplicate images on both the local server and S3 - and apparently has an issue with deleting from S3.
Let's clear the slate and start new. What would you like me to do first?
Thanks,
So, I took everything back to default / clean-state, meaning...
Users:
- Users only have default JomSocial Avatar image - local server
- Users only have default JomSocial Cover image - local server
- Deleted User Avatars from S3 - left the /folder structure
- Deleted User Covers from S3 - left the /folder structure
Groups & Events:
- Deleted the Groups / Events, so there are no images on local server
- Deleted the Groups / Events Avatars from S3, left the /folder structure
- Deleted the Groups / Events Covers from S3, left the /folder structure
Cron.php
- Set the cron.php file back to default, and removed the if($pCover) test
FFMPEG
I will triple check the ffmpeg version, but pretty sure its = 0.10.15 for RHEL/Centos 6.X 64-bit
Now we can test...
Hi, Brian.
I assign developer to this thread.
Thanks for sending it on Michael. I want to get this resolved before the site goes live if possible.
I have tested from my version of a clean-slate, mentioned in above thread and found the following:
User Avatar:
- User uploads a new avatar image, JS does the following:
JS creates (2) files on local server in /images/avatar/
- profile-1234.jpg
- stream_1234.jpg
- Both files are left on local server (I assume these should be removed if successfully transferred to S3)
Server fires off cron
- transfers/copies (2) files to S3 in bucket/images/avatar/
- thumb_1234.jpg
- 1234.jpg
- Both files are compressed smaller than the files found on local server
User Cover:
- User uploads a new cover image, JS does the following:
JS creates (1) folder on local server in /images/cover/profile/UserID/ ...no file
Server fires off cron
- transfers/copies (2) files to S3 in bucket/images/cover/profile/UserID/
- thumb_1234.jpg
- 1234.jpg
Originally, the cron threw error on line 853, because a folder was missing.
Warning: Invalid argument supplied for foreach() in
/home/XXXXXXXXXX/public_html/components/com_community/libraries/cron.php on line 853
After I delete the user/avatar and cover, the cron throws:
Warning: S3::deleteObject(): [BucketNotEmpty] The bucket you tried to delete is not empty in /home/XXXXXXX/public_html/components/com_community/libraries/storage/s3_lib.php on line 337
So, I have several questions like, why is the folder structure not consistent between server and S3? But, the overall issues feels like this is more JS S3-related and the Cron just happens to catch/see the problem and warn us of what's going on. But, I leave that too you to help explain.
Let me know what I can do to help.
Regards,
Brian
Hi Brian,
I think this is valid bug, I will add this to our bug list.
thank you
I give you the temp fix to hide warning error ..
Open this file /components/com_community/libraries/cron.php, find this code :
foreach ($pCover as $_pCoverId) {
$pUser = CFactory::getUser($_pCoverId);
if (is_null($pUser->username)) {
JFolder::delete($path . '/' . $folder . '/profile/' . $_pCoverId);
}
}
if(is_dir($pCover)){
foreach ($pCover as $_pCoverId) {
$pUser = CFactory::getUser($_pCoverId);
if (is_null($pUser->username)) {
JFolder::delete($path . '/' . $folder . '/profile/' . $_pCoverId);
}
}
}
Hi Dimas,
I swapped out the code like you asked, but received the following error:
Warning: is_dir() expects parameter 1 to be a valid path, array given in /home/XXXXXX/public_html/components/com_community/libraries/cron.php on line 854
...so switched the code back to default.
BTW - Were you able to confirm and/or make any progress on the bug with leaving duplicate folders/images on the server, when they should be moved to S3?