Author Topic: Erro 500: Internal Server Error (Finishing work on a task)  (Read 8148 times)

Butkcowsky

  • Newbie
  • *
  • Posts: 3
    • View Profile
Erro 500: Internal Server Error (Finishing work on a task)
« on: March 23, 2009, 12:23:35 pm »
Friends,

I'm taking the subject of error when trying to finish a job in a task, the result is attached to DEBUG if someone can help, thank...


Error (DBQueryError)
Query failed with message 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1'
Error params:
File: /usr/local/www/domains/....../public_html/environment/library/database/adapters/AbstractDBAdapter.class.php 
Line: 386 
Sql: SELECT * FROM `og_workspace_billings` WHERE project_id = '36' AND billing_id = 
Error number: 1064 
Error message: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 
Backtrace:
#0 /usr/local/www/domains/....../public_html/environment/library/database/adapters/AbstractDBAdapter.class.php(304): AbstractDBAdapter->prepareAndExecute('SELECT * FROM `...', NULL)
#1 /usr/local/www/domains/....../public_html/environment/library/database/DB.class.php(199): AbstractDBAdapter->executeAll('SELECT * FROM `...', NULL)
#2 /usr/local/www/domains/....../public_html/environment/classes/dataaccess/DataManager.class.php(182): DB::executeAll('SELECT * FROM `...')
#3 /usr/local/www/domains/....../public_html/application/models/workspace_billing/base/BaseWorkspaceBillings.class.php(112): DataManager->find(Array)
#4 /usr/local/www/domains/....../public_html/environment/classes/dataaccess/DataManager.class.php(228): BaseWorkspaceBillings->find(Array)
#5 /usr/local/www/domains/....../public_html/application/models/workspace_billing/base/BaseWorkspaceBillings.class.php(146): DataManager->findOne(Array)
#6 /usr/local/www/domains/....../public_html/application/models/workspace_billing/base/BaseWorkspaceBillings.class.php(148): BaseWorkspaceBillings->findOne(Array)
#7 /usr/local/www/domains/....../public_html/application/models/projects/Project.class.php(455): BaseWorkspaceBillings->findOne(Array)
#8 /usr/local/www/domains/....../public_html/application/controllers/TimeslotController.class.php(108): Project->getBillingAmount(0)
#9 /usr/local/www/domains/....../public_html/environment/classes/controller/Controller.class.php(75): TimeslotController->add_timespan()
#10 /usr/local/www/domains/....../public_html/environment/classes/controller/PageController.class.php(62): Controller->execute('add_timespan')
#11 /usr/local/www/domains/....../public_html/environment/classes/Env.class.php(133): PageController->execute('add_timespan')
#12 /usr/local/www/domains/....../public_html/init.php(146): Env::executeAction('timeslot', 'add_timespan')
#13 /usr/local/www/domains/....../public_html/index.php(9): require('/usr/local/www/...')
#14 {main}
Autoglobal varibles:
$_GET: Array (
  ['active_project'] => (string) '36'
  ['ajax'] => (string) 'true'
  ['c'] => (string) 'timeslot'
  ['a'] => (string) 'add_timespan'
  ['object_id'] => (string) '35'
  ['object_manager'] => (string) 'ProjectTasks'
  ['current'] => (string) 'tasks-panel'

$_POST: Array (
  ['timeslot'] => Array (
    ['description'] => (string) 'Foi realizada a instalação da nova versão do opManager no servidor Acol17...'
    ['time'] => (string) '1'
  )

$_COOKIE: Array (
  ['__utma'] => (string) '184370742.3624394078305067500.1234284749.1234957038.1236110298.4'
  ['__utmz'] => (string) '184370742.1234284749.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)'
  ['id'] => (string) '1'
  ['token'] => (string) '9ac2db02027bd6381c5d6f258c6519922685b93f'
  ['remember'] => (string) '1'
  ['PHPSESSID'] => (string) '87fba3c16266266f5d48ba126b12a175'

$_SESSION: Array (
  ['cal_version'] => true
  ['month'] => (string) '3'
  ['year'] => (string) '2009'
  ['day'] => (string) '23'
  ['total_task_times_report_data'] => Array (
    ['date_type'] => (string) '1'
    ['timeslot_type'] => (string) '0'
    ['start_value'] => (string) '23/03/2009'
    ['end_value'] => (string) '23/03/2009'
    ['user'] => (string) '0'
    ['project_id'] => (string) '0'
    ['include_subworkspaces'] => (string) 'checked'
    ['group_by_1'] => (string) '0'
    ['group_by_2'] => (string) '0'
    ['group_by_3'] => (string) '0'
    ['alt_group_by_1'] => (string) '0'
    ['alt_group_by_2'] => (string) '0'
    ['alt_group_by_3'] => (string) '0'
  )

Execution time:
Total execution time: 0.124356 seconds
« Last Edit: March 23, 2009, 02:31:12 pm by Butkcowsky »

Jim Rising

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Erro 500: Internal Server Error (Finishing work on a task)
« Reply #1 on: March 23, 2009, 06:38:48 pm »
i have a similar issue... and my webhost just recently upgraded from PHP 5.6.2 to PHP 5.6.9 ... it caused other issues with our sugarCRM, so i'm wondering if it's related?

Jim Rising

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Erro 500: Internal Server Error (Finishing work on a task)
« Reply #2 on: March 23, 2009, 06:50:28 pm »
here is my error_log:

[23-Mar-2009 11:48:35] PHP Warning:  Missing argument 3 for strpos_utf(), called in /home/jimrisin/public_html/redpepperstudios/goo/application/models/searchable_objects/SearchableObjects.class.php on line 107 and defined in /home/jimrisin/public_html/redpepperstudios/goo/environment/functions/utf.php on line 47
[23-Mar-2009 15:33:31] PHP Fatal error:  Uncaught exception 'InvalidParamError' with message 'There is no session matching this name (null for default session): NULL' in /home/jimrisin/public_html/redpepperstudios/goo/environment/classes/logger/Logger.class.php:83
Stack trace:
#0 /home/jimrisin/public_html/redpepperstudios/goo/init.php(153): Logger::log(Object(DBQueryError), 4)
#1 /home/jimrisin/public_html/redpepperstudios/goo/index.php(9): require('/home/jimrisin/...')
#2 {main}
  thrown in /home/jimrisin/public_html/redpepperstudios/goo/environment/classes/logger/Logger.class.php on line 83
[23-Mar-2009 15:34:26] PHP Fatal error:  Uncaught exception 'InvalidParamError' with message 'There is no session matching this name (null for default session): NULL' in /home/jimrisin/public_html/redpepperstudios/goo/environment/classes/logger/Logger.class.php:83
Stack trace:
#0 /home/jimrisin/public_html/redpepperstudios/goo/init.php(153): Logger::log(Object(DBQueryError), 4)
#1 /home/jimrisin/public_html/redpepperstudios/goo/index.php(9): require('/home/jimrisin/...')
#2 {main}
  thrown in /home/jimrisin/public_html/redpepperstudios/goo/environment/classes/logger/Logger.class.php on line 83

Butkcowsky

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Erro 500: Internal Server Error (Finishing work on a task)
« Reply #3 on: March 23, 2009, 06:55:48 pm »
I have this problem only after the update to version 1.3 ...

josellao

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: Erro 500: Internal Server Error (Finishing work on a task)
« Reply #4 on: March 24, 2009, 10:04:20 am »
I have the same problem after upgrade to v1.3. If you try to finish from the task view then it works fine.

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: Erro 500: Internal Server Error (Finishing work on a task)
« Reply #5 on: March 24, 2009, 11:27:34 am »
Everyone who's having this problem, take a look at file 'application/models/projects/Project.class.php' line 447. Function 'getBillingAmount' should look like this:

Code: [Select]
function getBillingAmount($billing_category_id){
if (!is_numeric($billing_category_id)) $billing_category_id = 0;
$wsBilling = WorkspaceBillings::findOne(
array('conditions' => array(
'project_id = ? AND billing_id = ?',
$this->getId(),
$billing_category_id
))
);
if ($wsBilling)
return $wsBilling->getValue();
else {
$parent = $this->getParentWorkspace();
if ($parent instanceof Project){
return $parent->getBillingAmount($billing_category_id);
} else {
$billing_category = BillingCategories::findById($billing_category_id);
if ($billing_category instanceof BillingCategory){
return $billing_category->getDefaultValue();
} else return 0;
}
}
}

Especially check that the first line is there and that the last question mark on line 451 is there.

josellao

  • Newbie
  • *
  • Posts: 5
    • View Profile
    • Email
Re: Erro 500: Internal Server Error (Finishing work on a task)
« Reply #6 on: March 24, 2009, 11:49:23 am »
thanks a lot Ignacio. your tip solvent the problem. It's working fine now. Good job.

Butkcowsky

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Erro 500: Internal Server Error (Finishing work on a task)
« Reply #7 on: March 24, 2009, 02:51:25 pm »
Thanks,
very good,  worked perfectly...


mediatech

  • Newbie
  • *
  • Posts: 12
    • View Profile
    • Mediatech Consulting
Re: Erro 500: Internal Server Error (Finishing work on a task)
« Reply #8 on: March 24, 2009, 03:09:17 pm »
+1  ;D

tamalita

  • Jr. Member
  • **
  • Posts: 70
    • View Profile
    • Enchanted Graphics
    • Email
Re: Erro 500: Internal Server Error (Finishing work on a task)
« Reply #9 on: March 24, 2009, 07:42:24 pm »
AWESOME!!!! thank yoU :)
Tamalita
Enchanted Graphics
Feng Office 1.7.3.1
Linux/PHP 5.2.14/MySQL 5.0.91

alison

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Erro 500: Internal Server Error (Finishing work on a task)
« Reply #10 on: March 25, 2009, 08:31:49 pm »
+1. Thanks!