OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



assertion failed

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

assertion failed

Postby asm » Sat Dec 18, 2010 1:39 pm

When trying to download the pdf of a published article the following message appears:


Code: Select all
ojs2 has produced an error
  Message: WARNING: assert(): Assertion failed
  In file: C:\inetpub\wwwroot3\ojs\classes\template\TemplateManager.inc.php
  At line: 35
  Stacktrace:
  Server info:
   OS: WINNT
   PHP Version: 5.3.0
   Apache Version: N/A
   DB Driver: mysql
   DB server version: 5.1.38-community
ojs2 has produced an error
  Message: WARNING: assert(): Assertion failed
  In file: C:\inetpub\wwwroot3\ojs\lib\pkp\classes\template\PKPTemplateManager.inc.php
  At line: 61
  Stacktrace:
  Server info:
   OS: WINNT
   PHP Version: 5.3.0
   Apache Version: N/A
   DB Driver: mysql
   DB server version: 5.1.38-community
PHP Fatal error:  Call to a member function getRouter() on a non-object in C:\inetpub\wwwroot3\ojs\lib\pkp\classes\template\PKPTemplateManager.inc.php on line 64


Also, in the Editing (Layout) window, When trying to View proof (the PDF of an article) / the Galley Format version, the following message apppears:


Code: Select all
ojs2 has produced an error
  Message: WARNING: assert(): Assertion failed
  In file: C:\inetpub\wwwroot3\ojs\lib\pkp\classes\core\PKPRequest.inc.php
  At line: 730
  Stacktrace:
  Server info:
   OS: WINNT
   PHP Version: 5.3.0
   Apache Version: N/A
   DB Driver: mysql
   DB server version: 5.1.38-community
PHP Fatal error:  Call to a member function getDispatcher() on a non-object in C:\inetpub\wwwroot3\ojs\lib\pkp\classes\core\PKPRequest.inc.php on line 636


Can you please make any suggestions as to how to make these errors disappear? Thank you for your time.
asm
 
Posts: 2
Joined: Sat Dec 18, 2010 1:08 pm

Re: assertion failed

Postby jmacgreg » Tue Dec 21, 2010 3:08 pm

Hi asm,

Which version of OJS are you using?

Cheers,
James
jmacgreg
 
Posts: 4181
Joined: Tue Feb 14, 2006 10:50 am

Re: assertion failed

Postby asm » Wed Dec 22, 2010 5:16 am

I am using version 2.3.3-3 on a Windows Server 2008 R2 machine with mySQL
asm
 
Posts: 2
Joined: Sat Dec 18, 2010 1:08 pm

Re: assertion failed

Postby mcrider » Mon Jan 03, 2011 1:28 pm

Hi asm,

Did you upgrade to this version of OJS or did you do a fresh install?

Also, it would be helpful if you could turn on show_stacktrace in your config.inc.php file and post the same errors but with stack traces included.

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: assertion failed

Postby dcamp » Fri Jan 07, 2011 10:12 am

Hi, Matt. I'm seeing the same problem on 2.3.3-3 as asm. Here are the same errors with stack traces included:

Code: Select all
[Fri Jan 07 11:04:40 2011] [error] [client 66.249.71.97] ojs2 has produced an error
  Message: WARNING: assert(): Assertion failed
  In file: /var/www/ojs-2.3/classes/template/TemplateManager.inc.php
  At line: 35
  Stacktrace:
   File: (unknown) line (unknown)
     Function: PKPApplication->errorHandler(2, "assert(): Assertion failed", "/var/www/ojs-2.3/classes/template/TemplateManager.inc.php", 35, Array(2))
   File: /var/www/ojs-2.3/classes/template/TemplateManager.inc.php line 35
     Function: assert(False)
   File: /var/www/ojs-2.3/lib/pkp/classes/template/PKPTemplateManager.inc.php line 340
     Function: TemplateManager->TemplateManager(Null)
   File: /var/www/ojs-2.3/pages/article/ArticleHandler.inc.php.new line 106
     Function: PKPTemplateManager->getManager()
   File: (unknown) line (unknown)
     Function: ArticleHandler->view(Array(2), Object(Request))
   File: /var/www/ojs-2.3/lib/pkp/classes/core/PKPRouter.inc.php line 370
     Function: call_user_func(Array(2), Array(2), Object(Request))
   File: /var/www/ojs-2.3/lib/pkp/classes/core/PKPPageRouter.inc.php line 266
     Function: PKPRouter->_authorizeInitializeAndCallRequest(Array(2), Object(Request), Array(2), False)
   File: /var/www/ojs-2.3/lib/pkp/classes/core/Dispatcher.inc.php line 129
     Function: PKPPageRouter->route(Object(Request))
   File: /var/www/ojs-2.3/lib/pkp/classes/core/PKPApplication.inc.php line 180
     Function: Dispatcher->dispatch(Object(Request))
   File: /var/www/ojs-2.3/index.php line 65
     Function: PKPApplication->execute()
  Server info:
   OS: Linux
   PHP Version: 5.3.3
   Apache Version: Apache/2.2.3 (Red Hat)
   DB Driver: mysql
   DB server version: 5.0.77
[Fri Jan 07 11:04:40 2011] [error] [client 66.249.71.97] ojs2 has produced an error
  Message: WARNING: assert(): Assertion failed
  In file: /var/www/ojs-2.3/lib/pkp/classes/template/PKPTemplateManager.inc.php
  At line: 61
  Stacktrace:
   File: (unknown) line (unknown)
     Function: PKPApplication->errorHandler(2, "assert(): Assertion failed", "/var/www/ojs-2.3/lib/pkp/classes/template/PKPTemplateManager.inc.php", 61, Array(2))
   File: /var/www/ojs-2.3/lib/pkp/classes/template/PKPTemplateManager.inc.php line 61
     Function: assert(False)
   File: /var/www/ojs-2.3/classes/template/TemplateManager.inc.php line 37
     Function: PKPTemplateManager->PKPTemplateManager(Null)
   File: /var/www/ojs-2.3/lib/pkp/classes/template/PKPTemplateManager.inc.php line 340
     Function: TemplateManager->TemplateManager(Null)
   File: /var/www/ojs-2.3/pages/article/ArticleHandler.inc.php.new line 106
     Function: PKPTemplateManager->getManager()
   File: (unknown) line (unknown)
     Function: ArticleHandler->view(Array(2), Object(Request))
   File: /var/www/ojs-2.3/lib/pkp/classes/core/PKPRouter.inc.php line 370
     Function: call_user_func(Array(2), Array(2), Object(Request))
   File: /var/www/ojs-2.3/lib/pkp/classes/core/PKPPageRouter.inc.php line 266
     Function: PKPRouter->_authorizeInitializeAndCallRequest(Array(2), Object(Request), Array(2), False)
   File: /var/www/ojs-2.3/lib/pkp/classes/core/Dispatcher.inc.php line 129
     Function: PKPPageRouter->route(Object(Request))
   File: /var/www/ojs-2.3/lib/pkp/classes/core/PKPApplication.inc.php line 180
     Function: Dispatcher->dispatch(Object(Request))
   File: /var/www/ojs-2.3/index.php line 65
     Function: PKPApplication->execute()
  Server info:
   OS: Linux
   PHP Version: 5.3.3
   Apache Version: Apache/2.2.3 (Red Hat)
   DB Driver: mysql
   DB server version: 5.0.77
[Fri Jan 07 11:04:40 2011] [error] [client 66.249.71.97] PHP Fatal error:  Call to a member function getRouter() on a non-object in /var/www/ojs-2.3/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 64
dcamp
 
Posts: 15
Joined: Wed Oct 27, 2010 3:05 pm

Re: assertion failed

Postby asmecher » Tue Jan 11, 2011 4:21 pm

Hi all,

This is strange behavior -- could you find line 35 in classes/template/TemplateManager.inc.php:
Code: Select all
assert(is_a($request, 'PKPRequest'));
...and before that, add:
Code: Select all
if (!is_a($request, 'PKPRequest')) {echo "Assertion failed.<br/>\n";print_r($request);exit();}
This will cause some more debugging information to be displayed before the line that's causing problems.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8306
Joined: Wed Aug 10, 2005 12:56 pm

Re: assertion failed

Postby farschidus » Sun Apr 03, 2011 1:35 am

Hi guys,

I've posted a topic similar to this, but get no answer.
my post is: http://pkp.sfu.ca/support/forum/viewtopic.php?f=8&t=7346

I have 10 OJS and 1 OCS on my Windows server. All the OJS except the last one are cool.
The problem began when I installed a new OJS with the latest version (2.3.4) lately. After that I tried to install a new OCS with the latest version (2.3.3-1). In both of them I get similar errors like this thread.

Is there something wrong with FastCGI on Windows Servers or it's some kind of OJS bug in php.

FYI, I'm an advanced .Net developer and an intermediate PHP programmer.

Cheers.
farschidus
 
Posts: 12
Joined: Thu May 14, 2009 5:59 am
Location: Tehran, Iran

Re: assertion failed

Postby jmacgreg » Tue Apr 05, 2011 9:54 pm

Hi Farshid,

Did Matt's reply in the previous thread solve this problem as well? If not, could you state the exact errors you are seeing, and where?

cheers,
James
jmacgreg
 
Posts: 4181
Joined: Tue Feb 14, 2006 10:50 am

Re: assertion failed

Postby farschidus » Wed Apr 06, 2011 11:22 pm

Hi James,

Thanks for your reply. I saw and replied Matt post. Matt and your replies came to me in one night when I sleep ;), (My time zone is Tehran, +3:30).If you interest, you can follow my issue in that post.

cheers,
farschidus
 
Posts: 12
Joined: Thu May 14, 2009 5:59 am
Location: Tehran, Iran

Re: assertion failed

Postby marchitelli » Mon Apr 18, 2011 10:47 am

Hi,
looking at my error.log, I found a lot of errors like this

[Mon Apr 18 19:44:41 2011] [error] [client 66.249.66.16] ojs2 has produced an error\n Message: WARNING: assert() [<a href='function.assert'>function.assert</a>]: Assertion failed\n In file: /var/ojs/classes/template/TemplateManager.inc.php\n At line: 35\n Stacktrace: \n Server info:\n OS: Linux\n PHP Version: 5.2.6-1+lenny10\n Apache Version: Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny10 with Suhosin-Patch\n DB Driver: postgres\n DB server version: PostgreSQL 8.3.14 on i486-pc-linux-gnu, compiled by GCC gcc-4.3.real (Debian 4.3.2-1.1) 4.3.2
[Mon Apr 18 19:44:41 2011] [error] [client 66.249.66.16] ojs2 has produced an error\n Message: WARNING: assert() [<a href='function.assert'>function.assert</a>]: Assertion failed\n In file: /var/ojs/lib/pkp/classes/template/PKPTemplateManager.inc.php\n At line: 61\n Stacktrace: \n Server info:\n OS: Linux\n PHP Version: 5.2.6-1+lenny10\n Apache Version: Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny10 with Suhosin-Patch\n DB Driver: postgres\n DB server version: PostgreSQL 8.3.14 on i486-pc-linux-gnu, compiled by GCC gcc-4.3.real (Debian 4.3.2-1.1) 4.3.2

I have this problem when I'm download a PDF file. Otherwise the download process is ok.

Andrea
marchitelli
 
Posts: 111
Joined: Tue May 22, 2007 12:44 am

Re: assertion failed

Postby jmacgreg » Sat Apr 23, 2011 11:50 am

Hi Andrea,

Have you tried adding Alec's debugging statement suggestion?

Cheers,
James
jmacgreg
 
Posts: 4181
Joined: Tue Feb 14, 2006 10:50 am

Re: assertion failed

Postby bdm » Thu May 02, 2013 6:29 pm

I am getting a problem that could be related to this thread. One of our articles consists of a PDF file (which is handled just fine) and a plain text file, let's call it "something.txt". Clicking on the something.txt link on the issue table of contents displays a copy of something.txt but following it is this:

Code: Select all
ojs2 has produced an error
  Message: WARNING: assert(): Assertion failed
  In file: /usr/local/share/ojs-2.3.6/classes/template/TemplateManager.inc.php
  At line: 35
  Stacktrace:
   File: (unknown) line (unknown)
     Function: PKPApplication->errorHandler(2, "assert(): Assertion failed", "/usr/local/share/ojs-2.3.6/classes/template/TemplateManager.inc.php", 35, Array(2))
   File: /usr/local/share/ojs-2.3.6/classes/template/TemplateManager.inc.php line 35
     Function: assert(False)
   File: /usr/local/share/ojs-2.3.6/lib/pkp/classes/template/PKPTemplateManager.inc.php line 340
     Function: TemplateManager->TemplateManager(Null)
   File: /usr/local/share/ojs-2.3.6/pages/article/ArticleHandler.inc.php line 106
     Function: PKPTemplateManager->getManager()
   File: (unknown) line (unknown)
     Function: ArticleHandler->view(Array(2), Object(Request))
   File: /usr/local/share/ojs-2.3.6/lib/pkp/classes/core/PKPRouter.inc.php line 370
     Function: call_user_func(Array(2), Array(2), Object(Request))
   File: /usr/local/share/ojs-2.3.6/lib/pkp/classes/core/PKPPageRouter.inc.php line 266
     Function: PKPRouter->_authorizeInitializeAndCallRequest(Array(2), Object(Request), Array(2), False)
   File: /usr/local/share/ojs-2.3.6/lib/pkp/classes/core/Dispatcher.inc.php line 129
     Function: PKPPageRouter->route(Object(Request))
   File: /usr/local/share/ojs-2.3.6/lib/pkp/classes/core/PKPApplication.inc.php line 180
     Function: Dispatcher->dispatch(Object(Request))
   File: /usr/local/share/ojs-2.3.6/index.php line 65
     Function: PKPApplication->execute()
  Server info:
   OS: Linux
   PHP Version: 5.3.3-7+squeeze8
   Apache Version: Apache/2.2.16 (Debian)
   DB Driver: postgres
   DB server version: PostgreSQL 8.4.11 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.4.real (Debian 4.4.5-8) 4.4.5, 64-bit<br/>


As you can see, I'm using version 2.3.6. The above error traceback also occurs in the web server error log, together with this:
Code: Select all
PHP Fatal error:  Call to a member function getRouter() on a non-object in /usr/local/share/ojs-2.3.6/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 64, referer: http://www.combinatorics.org/ojs/index.php/eljc/issue/view/ReviewVolume


Line 35 of /usr/local/share/ojs-2.3.6/classes/template/TemplateManager.inc.php is
Code: Select all
assert(is_a($request, 'PKPRequest'));


I changed this line as follows:
Code: Select all
if (!is_a($request, 'PKPRequest')) {echo "Assertion failed:\n";print_r($request); echo "Exiting\n";
  if ($request == null) echo "Request is null\n"; exit();}

and the output is
Code: Select all
Assertion failed:
Exiting
Request is null


Any suggestions?

Thanks in advance. Brendan.
bdm
 
Posts: 18
Joined: Sun Oct 11, 2009 10:30 pm

Re: assertion failed

Postby asmecher » Fri May 03, 2013 8:34 am

Hi Brendan,

This is bug #8160; see https://github.com/pkp/ojs/commit/ea3cf543cf14a03e27f894bd2fc073505b0d545f.diff for a patch.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8306
Joined: Wed Aug 10, 2005 12:56 pm

Re: assertion failed

Postby bdm » Fri May 03, 2013 8:58 pm

Alec wrote: "This is bug #8160..."

Indeed it is, and the patch fixed the problem.

Thanks!! Brendan.
bdm
 
Posts: 18
Joined: Sun Oct 11, 2009 10:30 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot] and 5 guests