Unprotected commands: Clear Data Caches and Clear Template Cache

Hi @asmecher,

Some error messages after clear cache;

[26-Jul-2019 05:56:47 Asia/Jakarta] PHP Parse error: syntax error, unexpected ‘’

All content is assigned a ’ (T_ENCAPSED_AND_WHITESPACE) in /home/stipwun2/public_html/ejournal/cache/fc-journalSettings-4.php on line 258

[26-Jul-2019 10:27:12 Asia/Jakarta] ojs2 has produced an error
Message: USER ERROR: Smarty error: [in common/minifiedScripts.tpl line 53]: syntax error: unidentified token ‘;d.style.setProperty(’–font-family-serif’,’ (Smarty_Compiler.class.php, line 1410)
In file: /home/stipwun2/public_html/ejournal/lib/pkp/lib/smarty/Smarty.class.php
At line: 1093
Stacktrace:
Server info:
OS: Linux
PHP Version: 5.6.40
Apache Version: N/A
DB Driver: mysql
DB server version: 10.2.25-MariaDB-cll-lve

[26-Jul-2019 14:54:05 Asia/Jakarta] ojs2 has produced an error
Message: USER ERROR: Smarty error: [in common/minifiedScripts.tpl line 53]: syntax error: unbalanced parenthesis in if statement (Smarty_Compiler.class.php, line 1277)
In file: /home/stipwun2/public_html/ejournal/lib/pkp/lib/smarty/Smarty.class.php
At line: 1093
Stacktrace:
Server info:
OS: Linux
PHP Version: 5.6.40
Apache Version: N/A
DB Driver: mysql
DB server version: 10.2.25-MariaDB-cll-lve

[26-Jul-2019 16:38:16 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 16:38:16 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 16:38:16 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 16:38:18 Asia/Jakarta] PHP Parse error: syntax error, unexpected ‘’

All content is assigned a ’ (T_ENCAPSED_AND_WHITESPACE) in /home/stipwun2/public_html/ejournal/cache/fc-journalSettings-4.php on line 258

[26-Jul-2019 16:51:34 Asia/Jakarta] PHP Fatal error: Call to a member function getCount() on null in /home/stipwun2/public_html/ejournal/cache/t_compile/%%38^38D^38D7420B%%article.tpl.php on line 444
[26-Jul-2019 16:51:35 Asia/Jakarta] ojs2 has produced an error
Message: USER ERROR: Smarty error: [in common/minifiedScripts.tpl line 53]: syntax error: unbalanced parenthesis in if statement (Smarty_Compiler.class.php, line 1277)
In file: /home/stipwun2/public_html/ejournal/lib/pkp/lib/smarty/Smarty.class.php
At line: 1093
Stacktrace:
Server info:
OS: Linux
PHP Version: 5.6.40
Apache Version: N/A
DB Driver: mysql
DB server version: 10.2.25-MariaDB-cll-lve

[26-Jul-2019 17:03:30 Asia/Jakarta] PHP Parse error: syntax error, unexpected ‘’

All content is assigned a ’ (T_ENCAPSED_AND_WHITESPACE) in /home/stipwun2/public_html/ejournal/cache/fc-journalSettings-4.php on line 258
[26-Jul-2019 17:03:30 Asia/Jakarta] PHP Parse error: syntax error, unexpected ‘’

All content is assigned a ’ (T_ENCAPSED_AND_WHITESPACE) in /home/stipwun2/public_html/ejournal/cache/fc-journalSettings-4.php on line 258
[26-Jul-2019 17:04:51 Asia/Jakarta] PHP Parse error: syntax error, unexpected ‘’

All content is assigned a ’ (T_ENCAPSED_AND_WHITESPACE) in /home/stipwun2/public_html/ejournal/cache/fc-journalSettings-4.php on line 258
[26-Jul-2019 17:04:53 Asia/Jakarta] PHP Parse error: syntax error, unexpected ‘’

All content is assigned a ’ (T_ENCAPSED_AND_WHITESPACE) in /home/stipwun2/public_html/ejournal/cache/fc-journalSettings-4.php on line 258
[26-Jul-2019 17:04:53 Asia/Jakarta] PHP Parse error: syntax error, unexpected ‘’

All content is assigned a ’ (T_ENCAPSED_AND_WHITESPACE) in /home/stipwun2/public_html/ejournal/cache/fc-journalSettings-4.php on line 258
[26-Jul-2019 17:04:53 Asia/Jakarta] PHP Parse error: syntax error, unexpected ‘’

All content is assigned a ’ (T_ENCAPSED_AND_WHITESPACE) in /home/stipwun2/public_html/ejournal/cache/fc-journalSettings-4.php on line 258
[26-Jul-2019 17:04:53 Asia/Jakarta] PHP Parse error: syntax error, unexpected ‘’

All content is assigned a ’ (T_ENCAPSED_AND_WHITESPACE) in /home/stipwun2/public_html/ejournal/cache/fc-journalSettings-4.php on line 258
[26-Jul-2019 17:05:01 Asia/Jakarta] PHP Parse error: syntax error, unexpected ‘’

All content is assigned a ’ (T_ENCAPSED_AND_WHITESPACE) in /home/stipwun2/public_html/ejournal/cache/fc-journalSettings-4.php on line 258
[26-Jul-2019 17:05:01 Asia/Jakarta] PHP Parse error: syntax error, unexpected ‘’

All content is assigned a ’ (T_ENCAPSED_AND_WHITESPACE) in /home/stipwun2/public_html/ejournal/cache/fc-journalSettings-4.php on line 258
[26-Jul-2019 17:05:01 Asia/Jakarta] PHP Parse error: syntax error, unexpected ‘’

All content is assigned a ’ (T_ENCAPSED_AND_WHITESPACE) in /home/stipwun2/public_html/ejournal/cache/fc-journalSettings-4.php on line 258
[26-Jul-2019 17:05:01 Asia/Jakarta] PHP Parse error: syntax error, unexpected ‘’

All content is assigned a ’ (T_ENCAPSED_AND_WHITESPACE) in /home/stipwun2/public_html/ejournal/cache/fc-journalSettings-4.php on line 258
[26-Jul-2019 17:05:03 Asia/Jakarta] PHP Parse error: syntax error, unexpected ‘’

All content is assigned a ’ (T_ENCAPSED_AND_WHITESPACE) in /home/stipwun2/public_html/ejournal/cache/fc-journalSettings-4.php on line 258
[26-Jul-2019 17:05:03 Asia/Jakarta] PHP Parse error: syntax error, unexpected ‘’

All content is assigned a ’ (T_ENCAPSED_AND_WHITESPACE) in /home/stipwun2/public_html/ejournal/cache/fc-journalSettings-4.php on line 258
[26-Jul-2019 17:05:22 Asia/Jakarta] ojs2 has produced an error
Message: USER WARNING: Smarty error: unable to read resource: “common/navbar-mobile.tpl”
In file: /home/stipwun2/public_html/ejournal/lib/pkp/lib/smarty/Smarty.class.php
At line: 1093
Stacktrace:
Server info:
OS: Linux
PHP Version: 5.6.40
Apache Version: N/A
DB Driver: mysql
DB server version: 10.2.25-MariaDB-cll-lve

I cant found more except that some errors message that.

Regards,
Rochmady

Hi @Rochmady,

Can you quote more lines around line 258 of cache/fc-journalSettings-4.php?

Are you sure all modifications have been removed from minifiedTemplates.tpl?

I see signs of other customizations causing problems, e.g. a reference to navbar-mobile.tpl, which seems to have been added (and doesn’t exist in stock OJS).

I don’t know what changes have been made to your installation – but you might consider backing them out.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

This is mesaage in line 258;
'en_US' => '<p>All content is assigned a <a href="https://search.crossref.org/" target="_blank">Digital Object Identifier</a> (DOI) prefix code: 10.29239/simnas. All metadata is openly available for harvesting by indexing services via OAI-PMH and journals are registered with Open Archives.</p><p>As member of <a href="https://www.lockss.org/" target="_blank">LOCKSS </a>(Lots of Copies Keep Stuff Safe) our content is r

Ya, sure

Some time ago this file was added to the header, but I deleted it. Now there is no more in the OJS header script. Why does it still appear in the error message?

Ya, ya, sure I have made changes by removing the navbar-mobile.tpl file.

Regards,
Rochmady

Hi @Rochmady,

I’m asking not just for that single line of the cache file, but for more of the lines above and below it.

I still suspect there are modifications causing trouble. If this were my installation, I’d try running a fresh unpack of the code in a clean directory, setting up config.inc.php to the existing files directory and database. If that works, it suggests problems with modifications.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

No, no … Before going too far to find the cause, I need to explain the chronology of the clear cache that I have done.

plugins/blocks/keywordCloudBlockPlugin.inc.php line 18,19;

define('KEYWORD_BLOCK_MAX_ITEMS', 20); define('KEYWORD_BLOCK_CACHE_DAYS', 2);

First, I did modify in plugins/blocks/keywordCloudBlockPlugin.inc.php on lines 18 and 19. I changed line 18 from 20 to 10 items and line 19 from 2 to 7 days. And after that change, I then did the Clear cache in the hope that the keyword would only display data on the 10 most popular items for 7 days and it did. Occurs in the Agrikan journal in https://ejournal.stipwunaraha.ac.id/index.php/agrikan, and the Akuatikisle journal in https://ejournal.stipwunaraha.ac.id/index.php/ISLE and other journals. But that change did not occur in the Simnas journal. In the Simnas journal, it can’t even be aired. The point of the question is whether this change cannot be done?

Second, I use the mpg theme for the Simnas and Akuatikisle journal. My common logic is that if two units with the same character are changed, they should be affected equally. But in this case, the change in keyword cloud was just a problem in Simnas but not in Akuatikisle. Even though the theme (characteristics) is the same. Supposedly if Simnas cannot load then Akuatikisle also, vice versa. The reality is just the opposite, Akuatikisle works normally, Simnas is blank. Point of a question, Why?

Third, I use the default theme OJS for Agrikan in https://ejournal.stipwunaraha.ac.id/index.php/agrikan. Changes in keyword cloud had no problems in the journal. At least so far there have been no problems, whether the day after tomorrow.

Fourth, because the Simnas journal was blank, I restored it to the first set as before. But because it has not been successfully loaded, then I overwrite the file with the file from the developer.

That’s the chronology. Thus. So what’s the solution?

Regards,
Rochmady

Hi @Rochmady,

I’m just going by the error messages you’ve posted – this is an incomplete picture but gives some hints.

When the cache files are missing (both template and data caches), or when the cache file is older than the file the cache is generated from, then OJS re-generates the cached data. Otherwise it relies on the cache for better performance.

In at least a couple of cases (the reference to navbar-mobile.tpl and the Javascript in minifiedTemplates.tpl), the error messages suggest that modifications were made to the .tpl files that broke the templates. For whatever reason OJS didn’t try to recompile the files until after the template caches were cleared – if the broken .tpl files had older dates than the cache files, that would explain why. But as soon as the template caches were cleared, the broken template files could not be recompiled and the system stopped working.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi, @asmecher

Ok, thanks so I found out.

For that reason, does that mean all the changes I made should be deleted or returned to the default template so that OJS recompiles the file?

Especially for navbar-mobile.tpl and minifiedScripts.tpl I have adjusted it according to this instruction [quote].

I just want the journal to recover. That is all.

Regards
Rochmady

Hi @Rochmady,

Yes, that’s what I’d suggest, at least temporarily so you can determine whether & which changes are causing trouble.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi, @asmecher

Okay, I consider the advice. I will contact again if there are still problems after changing to the default OJS. Thanks.

Regards
Rochmady

Hi @asmecher,

I came back, today I have completed it according to your advice.

All changes have been restored according to the initial installation. I upload the original file and then overwrite the file that was previously changed.

Well, now the results have not been seen. This journal has not yet appeared.

What should I do next? I am waiting.

Regards
@Rochmady

Hi @Rochmady,

What do you see now in your PHP error log?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

The following is a list of errors

[15-Sep-2019 04:00:25 Asia/Jakarta] PHP Fatal error: Call to a member function getCount() on null in /home/stipwun2/public_html/ejournal/cache/t_compile/%%38^38D^38D7420B%%article.tpl.php on line 515
[15-Sep-2019 04:01:28 Asia/Jakarta] PHP Parse error: syntax error, unexpected ‘’

All content is assigned a ’ (T_ENCAPSED_AND_WHITESPACE) in /home/stipwun2/public_html/ejournal/cache/fc-journalSettings-4.php on line 258
[15-Sep-2019 04:02:32 Asia/Jakarta] PHP Parse error: syntax error, unexpected ‘’

All content is assigned a ’ (T_ENCAPSED_AND_WHITESPACE) in /home/stipwun2/public_html/ejournal/cache/fc-journalSettings-4.php on line 258
[15-Sep-2019 04:02:32 Asia/Jakarta] ojs2 has produced an error
Message: WARNING: rawurlencode() expects parameter 1 to be string, object given
In file: /home/stipwun2/public_html/ejournal/lib/pkp/classes/core/PKPPageRouter.inc.php
At line: 298
Stacktrace:
Server info:
OS: Linux
PHP Version: 5.6.40
Apache Version: N/A
DB Driver: mysql
DB server version: 10.2.26-MariaDB-cll-lve
[15-Sep-2019 04:04:56 Asia/Jakarta] PHP Parse error: syntax error, unexpected ‘’

All content is assigned a ’ (T_ENCAPSED_AND_WHITESPACE) in /home/stipwun2/public_html/ejournal/cache/fc-journalSettings-4.php on line 258
[15-Sep-2019 04:09:34 Asia/Jakarta] PHP Fatal error: Call to a member function getCount() on null in /home/stipwun2/public_html/ejournal/cache/t_compile/%%38^38D^38D7420B%%article.tpl.php on line 515
[15-Sep-2019 04:13:25 Asia/Jakarta] PHP Fatal error: Call to a member function getCount() on null in /home/stipwun2/public_html/ejournal/cache/t_compile/%%38^38D^38D7420B%%article.tpl.php on line 515
[15-Sep-2019 04:19:36 Asia/Jakarta] ojs2 has produced an error
Message: WARNING: rawurlencode() expects parameter 1 to be string, object given
In file: /home/stipwun2/public_html/ejournal/lib/pkp/classes/core/PKPPageRouter.inc.php
At line: 298
Stacktrace:
Server info:
OS: Linux
PHP Version: 5.6.40
Apache Version: N/A
DB Driver: mysql
DB server version: 10.2.26-MariaDB-cll-lve
[17-Sep-2019 01:15:40 Asia/Jakarta] PHP Fatal error: Call to a member function getCount() on null in /home/stipwun2/public_html/ejournal/cache/t_compile/%%38^38D^38D7420B%%article.tpl.php on line 522
[17-Sep-2019 01:15:57 Asia/Jakarta] ojs2 has produced an error
Message: WARNING: rawurlencode() expects parameter 1 to be string, object given
In file: /home/stipwun2/public_html/ejournal/lib/pkp/classes/core/PKPPageRouter.inc.php
At line: 298
[17-Sep-2019 01:35:06 Asia/Jakarta] PHP Fatal error: Call to a member function getCount() on null in /home/stipwun2/public_html/ejournal/cache/t_compile/%%38^38D^38D7420B%%article.tpl.php on line 522
[17-Sep-2019 01:35:52 Asia/Jakarta] PHP Parse error: syntax error, unexpected ‘’

All content is assigned a ’ (T_ENCAPSED_AND_WHITESPACE) in /home/stipwun2/public_html/ejournal/cache/fc-journalSettings-4.php on line 258
[17-Sep-2019 01:36:13 Asia/Jakarta] PHP Fatal error: Call to a member function getCount() on null in /home/stipwun2/public_html/ejournal/cache/t_compile/%%38^38D^38D7420B%%article.tpl.php on line 522
[17-Sep-2019 01:36:19 Asia/Jakarta] PHP Parse error: syntax error, unexpected ‘’

All content is assigned a ’ (T_ENCAPSED_AND_WHITESPACE) in /home/stipwun2/public_html/ejournal/cache/fc-journalSettings-4.php on line 258
[17-Sep-2019 01:37:27 Asia/Jakarta] PHP Fatal error: Call to a member function getCount() on null in /home/stipwun2/public_html/ejournal/cache/t_compile/%%38^38D^38D7420B%%article.tpl.php on line 522
[17-Sep-2019 01:40:26 Asia/Jakarta] ojs2 has produced an error
Message: WARNING: rawurlencode() expects parameter 1 to be string, object given
In file: /home/stipwun2/public_html/ejournal/lib/pkp/classes/core/PKPPageRouter.inc.php
At line: 298
[16-Oct-2019 17:28:24 Asia/Jakarta] PHP Parse error: syntax error, unexpected ‘’

All content is assigned a ’ (T_ENCAPSED_AND_WHITESPACE) in /home/stipwun2/public_html/ejournal/cache/fc-journalSettings-4.php on line 258
[17-Oct-2019 16:32:46 Asia/Jakarta] PHP Fatal error: Call to a member function getQualifiedDAOName() on null in /home/stipwun2/public_html/ejournal/lib/pkp/classes/db/DAORegistry.inc.php on line 63
[18-Oct-2019 19:07:32 Asia/Jakarta] PHP Fatal error: Call to a member function getQualifiedDAOName() on null in /home/stipwun2/public_html/ejournal/lib/pkp/classes/db/DAORegistry.inc.php on line 63
[19-Oct-2019 05:54:33 Asia/Jakarta] ojs2: DB Error: Duplicate entry ‘fopkrje7r267mos8soik6825b3’ for key ‘sessions_pkey’
[19-Oct-2019 09:54:46 Asia/Jakarta] PHP Fatal error: Call to a member function getId() on null in /home/stipwun2/public_html/ejournal/lib/pkp/pages/notification/NotificationHandler.inc.php on line 189
[19-Oct-2019 16:36:38 Asia/Jakarta] PHP Fatal error: Call to a member function getQualifiedDAOName() on null in /home/stipwun2/public_html/ejournal/lib/pkp/classes/db/DAORegistry.inc.php on line 63
[23-Oct-2019 01:47:23 Asia/Jakarta] PHP Parse error: syntax error, unexpected ‘’

All content is assigned a ’ (T_ENCAPSED_AND_WHITESPACE) in /home/stipwun2/public_html/ejournal/cache/fc-journalSettings-4.php on line 258

More is here

Regards,
Rochmady

Hi @Rochmady,

Can you describe what you did to clean up your installation? It still seems like something is very wrong.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I do this

All files that have changed, I return it by replacing the file. Are there any mistakes? Or is there another way?

Regards
Rochmady

Hi @Rochmady,

If there is malware on your system, it’s likely installed itself in various places in your webroot, potentially both modifying existing code and adding new scripts. The only way to be sure that it’s clear is to review everything. I’d suggest looking into tools like diff to do this. Clearing up this issue is beyond the scope of this forum – you’ll find helpful guides elsewhere on the Internet. The process will be the same for OJS as it would be for Drupal or Wordpress or other PHP applications.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

What do you mean Malware? Our webroot has its own security, namely Imunify360 and ModSecurity which is installed in all domains and webroot.

Can be more specific, we do not understand your advice.

Regards
Rochmady

Hi @Rochmady,

Sorry about the reference to malware – I misremembered the details of this thread. However, warnings about syntax errors in the cache file like this:

All content is assigned a ’ (T_ENCAPSED_AND_WHITESPACE) in /home/stipwun2/public_html/ejournal/cache/fc-journalSettings-4.php on line 258

…and…

ojs2: DB Error: Duplicate entry ‘fopkrje7r267mos8soik6825b3’ for key ‘sessions_pkey

…can indicate that malware is modifying the OJS cache files and interfering with session management.

About this error message:

[17-Sep-2019 01:37:27 Asia/Jakarta] PHP Fatal error: Call to a member function getCount() on null in /home/stipwun2/public_html/ejournal/cache/t_compile/%%38^38D^38D7420B%%article.tpl.php on line 522

Are you sure there are no custom modifications to pages/article/ArticleHandler.inc.php, or third-party plugins that intervene in the article display?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Thank you for reviewing more about my OJS problem.

I make sure I never modify this part.

However, changes can occur due to the installation of plugins that may interfere with session management. Indeed, I once installed MPG Theme plugins, statistical plugins, and popular article plugins. But I have removed all those plugins according to your advice.

This error message still displays it:

[16-Oct-2019 10:42:06 Asia/Jakarta] ojs2 has produced an error
Message: CAUGHT EXCEPTION: Object of class User could not be converted to string
In file: /home/stipwun2/public_html/ejournal/cache/t_compile/mpgTheme^%%53^536^5362050E%%header-people.tpl.php
At line: 316
Stacktrace:
Server info:
OS: Linux
PHP Version: 5.6.40
Apache Version: N/A
DB Driver: mysql
DB server version: 10.2.27-MariaDB-cll-lve

Even though I have removed the plugins.

What is the next step that I take?

Regards
Rochmady

Hi @Rochmady,

The “mpgTheme” part of that filename suggests that there’s still at least part of the MPG theme plugin installed – that’s not part of OJS. I’d suggest making sure that the plugin is removed and that your journal is configured to use another theme (e.g. the default theme plugin).

Regards,
Alec Smecher
Public Knowledge Project Team