Hy,
i hope anybody can help me,
when i open my cron.php with browser it runs correct. But when the cron runs from the system, i become a error.
The Error message:
[code]
Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/vhosts/smileandgo.de/httpdocs/modules/goesi/fbook_event-import/classes/GoesiFbCron.php on line 231
[/code]
On this code stay:
[code]
// $iProfileId = 1; $iRet = BxDolService::call( 'photos', 'perform_photo_upload', array( $sPath, $aFileInfo, false ), 'Uploader' );
$subFrndQuery = "SELECT `bx_photos_main`.* FROM `bx_photos_main` WHERE `bx_photos_main`.`Owner` = '{$iProfileId}' ORDER BY `bx_photos_main`.`Date` DESC LIMIT 1"; if ( $iRet ) $subFrndRes = mysql_query($subFrndQuery) or die(mysql_error()); } $subFrndRes; while ($subFrndArr = mysql_fetch_assoc($subFrndRes)) { $PicID = $subFrndArr['ID'];
[/code]
Execly this line make the error [code]while ($subFrndArr = mysql_fetch_assoc($subFrndRes)) { [/code]
I dont know why..... when i open the cron with the browser it runs correct.... no errors..
--Germany-- Sorry for my bad english :P |
I don't really think the problem is with the cron, I think the problem is with the facebook event module. Did you try contacting the author? BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin |
I`m the Author...
I dont have see the problem, in the programming phase. I had open the cron with the browser to test it.
But, my costumers send me a report from the cron, thats the pictures are away when the cron was run.
So, i have tested the cron over the terminal php -v .../.../../periodic/cron.php and see.... there is a error on the while... but i dont know why...
--Germany-- Sorry for my bad english :P |
This will not set, BxDolService::call
is not set when i run it with the cron... but why.... need this a cookie or anything?
--Germany-- Sorry for my bad english :P |
It shouldn't need a cookie set. Did you put the lines at the of the file to connect to the Dolphin database?
$GLOBALS['bx_profiler_disable'] = true; define('BX_DOL_CRON_EXECUTE', '1');
$aPathInfo = pathinfo(__FILE__); require_once ($aPathInfo['dirname'] . '/../../../inc/header.inc.php'); require_once(BX_DIRECTORY_PATH_INC . 'utils.inc.php'); require_once(BX_DIRECTORY_PATH_INC . 'profiles.inc.php' ); require_once(BX_DIRECTORY_PATH_CLASSES . 'BxDolDb.php');
You might need to adjust the path to the header.inc.php depending on how deep your module is.
BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin |
Thx for replay,
This is my cron header:
bx_import('BxDolCron');
require_once('GoesiFbModule.php');
class goesi_fb_cron extends BxDolCron { var $oSpyObject; var $iDaysForRows;
/** * Class constructor; */ function goesi_fb_cron() { //echo 'Facebook Event Import:<br>'; // Anfang $this -> oModule = BxDolModule::getInstance('GoesiFbModule');
i must only set the header.inc.php ?
--Germany-- Sorry for my bad english :P |
Put all these lines in and see what happens:
$GLOBALS['bx_profiler_disable'] = true; define('BX_DOL_CRON_EXECUTE', '1');
$aPathInfo = pathinfo(__FILE__); require_once ($aPathInfo['dirname'] . '/../../../inc/header.inc.php'); require_once(BX_DIRECTORY_PATH_INC . 'utils.inc.php'); require_once(BX_DIRECTORY_PATH_INC . 'profiles.inc.php' ); require_once(BX_DIRECTORY_PATH_CLASSES . 'BxDolDb.php');
I think that message "not a valid MySQL result resource" means it isn't connected to the database.
BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin |
ok,
i have put your code in there..
but the same:
[code]
**:~# php -q /var/www/vhosts/smileandgo.de/httpdocs/periodic/cron.php Facebook Event Import:<br><br>HTTP:10 Links<br>0= 179570212146161<br> Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/vhosts/smileandgo.de/httpdocs/modules/goesi/fbook_event-import/classes/GoesiFbCron.php on line 243 1= 322599587790483<br> Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/vhosts/smileandgo.de/httpdocs/modules/goesi/fbook_event-import/classes/GoesiFbCron.php on line 243 2= 147929828658269<br> Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/vhosts/smileandgo.de/httpdocs/modules/goesi/fbook_event-import/classes/GoesiFbCron.php on line 243 3= 169458726503704<br>^C smileandgo:~#
[/code]
--Germany-- Sorry for my bad english :P |
ok its is the
$iRet = BxDolService::call( 'photos', 'perform_photo_upload', array( $sPath, $aFileInfo, false ), 'Uploader' );
this need a user, where the pictures are saved... how can i force a user to this?... by adding $aProfile1 ?
--Germany-- Sorry for my bad english :P |
I think this problem needs a bigger brain than mine, Deano are you out there?? BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin |
--Germany-- Sorry for my bad english :P |
hmmm...the last time that happened to me it was because the cron was not connecting to the mysql server.
I was able to run it from the web page but not from cron.
What I did was I created an absolute path to my header.inc.php file so the php file that had the cron code knew exactly where to get database info.
For now, try hard coding the database auth/credentials and see if that works.
Cron will not know where the db is when running via the system.
Updating my BoonexNerd.net site. |
it is not the sql.
i have before the error place come, 5 another sql statments.
To check the time, to check the description of the event, to check if the location active and and and...
$iRet = BxDolService::call( ...
that is empty... and when its empty, the job will not find the last picture.
When i remove the if ($iRet ) the script will ever catch the last entry. And put on all events the same picture.
So, the BxDolService::call put my catched photo in the database and in the right folder for pictures.
But only when i open the cron with the browser.
When the cron runs alone, the BxDolService::call will not work.
--Germany-- Sorry for my bad english :P |
--Germany-- Sorry for my bad english :P |
--Germany-- Sorry for my bad english :P |
--Germany-- Sorry for my bad english :P |
Webby0815,
What OS are you using? Linux? Windows? OSX?
I am wondering if it might be a permissions issue. From what I understand you can run it from the Web? So as a guest web user it runs but not from cron or terminal.
Just a thought and I hope it gets figured out. I know it gets frustrating sometimes and it could be just 1 tiny thing like a setting of some sort.
Updating my BoonexNerd.net site. |
Hy!
On the Server is Linux Debian.
Cron : BxDolService::call not work
Terminal: BxDolService::call not work
Open in Webbrowser: All works fine.
Yes, this is frustration..
Its only one function that not running, and this is... for my users important This is the image import.
The another informations will correct import to my site.
--Germany-- Sorry for my bad english :P |
--Germany-- Sorry for my bad english :P |
--Germany-- Sorry for my bad english :P |
push push push push push.... --Germany-- Sorry for my bad english :P |
There are only a handfull of GOOD programers here and Jtadeo is probably one of the best.. I think it's safe to say no one here knows how to solve your problem.
The fact the problem is coming from code you wrote yourself makes it almost impossible for someone to fix it by just taking wild guesses on a forum.
BoonEx Certified Host: Zarconia.net - Fully Supported Shared and Dedicated for Dolphin |
Ok, so if I understand correctly....
You can manually run your cronjob by opening a web browser and navigating directly to the cron:
Example: www.mysite.com/periodic/cron.php
Is that correct?
If you can do that but NOT allow the cron to run on it's own, then my first guess is that your cron statement is not setup correctly inside the cron jobs manager.
Im still confused about this error though: Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /var/www/vhosts/smileandgo.de/httpdocs/modules/goesi/fbook_event-import/classes/GoesiFbCron.php on line 231
You said: Execly this line make the error [code]while ($subFrndArr = mysql_fetch_assoc($subFrndRes)) {
So I see the opening { but do not see the closing one. I hope its somewhere down therein the code somewhere. I also noticed the closing } on die(mysql_error()); } but didnt see the open one for that. Not sure that has anything to do with it though..
I would definitely check your cron statement to see if that fixes it. Here are a few examples of common cron statements:
Most common configurations:
* * * * * /usr/local/bin/php -q /home/sitedir/public_html/periodic/cron.php
* * * * * /usr/bin/php -q /home/sitedir/public_html/periodic/cron.php
-I have also found that some Crons (depending on your host) have difficulties "calling" the cron job to run. I have been able to resolve this by specifying the location of the php configurations and manually entering it into the cron job command: (See below)
* * * * * /usr/bin/php -c /home/sitedir/public_html/php.ini -q /home/sitedir/public_html/periodic/cron.php
You can read the full post here:
http://www.boonex.com/forums/topic/Troubleshooting-Crons-Videos-Migrations-RMS.htm
Nothing to see here |
@Webby0815,
Let's get some more info.
SSH into your account and type. Type in:
crontab -e
That should launch a list of the current cron jobs. If it's got a # in front on a line, that means it won't run. If it's not listed, then for sure it won't run. Your php file that you want cron to run should be there.
Updating my BoonexNerd.net site. |
Yes,
i have solved the problem. Know the user must input there logindata in to the file, and a curl open the BxDolService::call.
The problem is not the cron, the problem is "BxDolService::call" need a "real" login user with cookie...
--Germany-- Sorry for my bad english :P |
Good to hear you've solved it and for sharing your results.
I am certain it was very frustrating, but you kept at it and solve it yourself. That is always a good feeling.
Yes,
i have solved the problem. Know the user must input there logindata in to the file, and a curl open the BxDolService::call.
The problem is not the cron, the problem is "BxDolService::call" need a "real" login user with cookie...
Updating my BoonexNerd.net site. |
Just a question are you using parallels plesk panel ? because sometimes if you are not granted the correct permissions for shell access the cron will not fire .
happy thoughts
|
the cron is fired.
It works now... but not with the BxDolCron.
--Germany-- Sorry for my bad english :P |