Unprotected commands: Clear Data Caches and Clear Template Cache

Hi @asmecher
For some reasons the actions have “Clear Data cache and Clear cache template” is under no protection notification. It is was to work like this? Seems so dangerous or and not have any notification or tip to notificate user about the action that will executed. :thinking:


att

I do not think that clearing OJS cache would end user sessions. If that is what you are worried about?

Hi @Glauco_Roberto_Munsb,

Agreed, those should probably be behind a Javascript confirmation (though this change is a low priority). See https://github.com/pkp/pkp-lib/issues/2472.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

@ajnyga

I only think that actions like that need a dialog confirmation :boy:

1 Like

I’m unclear what about the “Clear Data Caches” or “Clear Template Caches” actions would suggest a need to confirmation. Unlike “Expire User Sessions” or “Clear Scheduled Task Logs”, there is no data loss involved.

On the other hand, I’d argue that each of these actions should be an HTTP POST rather than an HTTP GET, just to distinguish that each of these are data-change requests, not data-fetch requests.

Hi @ctgraham,

Agreed re: making these POST operations. I’ve added that to the entry.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

HI @Glauco_Roberto_Munsb, @asmecher, @ctgraham

I did a Clear Data Cache some time ago, and I don’t know the consequences. But after I do, one of our journal links can’t load. Look at this https://ejournal.stipwunaraha.ac.id/index.php/SIMNAS and this https://ejournal.stipwunaraha.ac.id/

Then, what is the action to make the journal link back to normal?

Hi @Rochmady,

Those commands shouldn’t cause any harm beyond a slightly slower next page load. Can you check your PHP error log to see if anything relevant is there?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Before I forget,
OJS system ver 2.4.8

I remember the clear cache date and time, in the PHP error log for that date the information is like this:

[26-Jul-2019 05:43:49 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.25-MariaDB-cll-lve
[26-Jul-2019 05:44:14 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 05:44:14 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 05:44:14 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 05:44:15 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 05:44:15 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 05:44:15 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 05:44:21 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 05:44:21 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 05:44:21 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 05:44:21 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 05:44:32 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 05:44:32 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 05:44:32 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 05:44:32 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 05:44:32 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 05:44:33 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 05:44: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 05:44:54 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 05:44:55 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 05:44:59 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 05:45:07 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 05:45:07 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 05:45:07 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 05:45:09 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 05:45:09 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 05:45:09 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 05:45:09 Asia/Jakarta] ojs2: 404 Not Found
[26-Jul-2019 05:45:14 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 05:45:16 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 05:45:23 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
[26-Jul-2019 05:45:23 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.25-MariaDB-cll-lve
[26-Jul-2019 05:45: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
[26-Jul-2019 05:45:46 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 05:45: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 05:45: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 05:45: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 05:45: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 05:45: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 05:45: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 05:45:54 Asia/Jakarta] ojs2 has produced an error
Message: WARNING: unlink(/home/stipwun2/public_html/ejournal/cache/fc-pluginSettings-0-objectsforreviewplugin.php): No such file or directory
In file: /home/stipwun2/public_html/ejournal/lib/pkp/classes/cache/FileCache.inc.php
At line: 57
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 05:45:54 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 05:45:54 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 05:45:54 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 05:45: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
[26-Jul-2019 05:45: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
[26-Jul-2019 05:46:02 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 05:46:03 Asia/Jakarta] ojs2 has produced an error
Message: WARNING: unlink(/home/stipwun2/public_html/ejournal/cache/fc-pluginSettings-0-objectsforreviewplugin.php): No such file or directory
In file: /home/stipwun2/public_html/ejournal/lib/pkp/classes/cache/FileCache.inc.php
At line: 57
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 05:46: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 05:46: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 05:46: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 05:46:04 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 05:46:04 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 05:46:11 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 05:46:11 Asia/Jakarta] ojs2 has produced an error

I can attach a PHP error log file but it’s too big.

Best regards,
Rochmady

Hi @Rochmady,

What do you see in cache/fc-journalSettings-4.php around line 258? It looks like there’s a problem there.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

I see this;

'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

So how is it fixed, I can’t log in as Journal Manager or as an editor in this journal?

Regards,
Rochmady

Hi @Rochmady,

I’ll need the surrounding lines too – there’s nothing incriminating there.

Also check templates/common/minifiedScripts.tpl around line 53.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Is this also relevant?;

[26-Jul-2019 06:26:02 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

and than;

[26-Jul-2019 06:16:46 Asia/Jakarta] PHP Parse error: syntax error, unexpected ''<p>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 06:17:17 Asia/Jakarta] ojs2 has produced an error

FYI, after clear cache I also cannot log in the journal admin, cannot edit my profile. Multiple functions in https://ejournal.stipwunaraha.ac.id/index.php/index/search and journal categories in https://ejournal.stipwunaraha.ac.id/index.php/index/search/categories do not appear. In the error log, what do?

Regards,
Rochmady

Hi @Rochmady,

Can you post the snippets I requested here?

Thanks,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

in templates/common/minifiedScripts.tpl line 53 i found this;

<script>(function(d){if (sessionStorage.fontsLoaded){d.style.setProperty('--font-family-sans', 'Europa');d.style.setProperty('--font-family-serif', 'Noto Serif')}})(document.documentElement);</script>

Regards,
Rcohmady

Hi @Rochmady,

Ah, that’s at least part of your problem – there’s a modification there that breaks the template syntax. I’d suggest restoring that template back to the version you got from your OJS installation package.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

Ok, i would try. I hope it solved that trouble.

Regards,
Rochmady

Hi @asmecher,

I have followed your message here;

I restored the OJS file version but it has not been able to load successfully. Does the system need restoring time? Or is there another problem?

Regards,
Rochmady

Hi @Rochmady,

That should have resolved the message:

 Smarty error: [in common/minifiedScripts.tpl line 53]: syntax error: unbalanced parenthesis in if statement (Smarty_Compiler.class.php, line 1277)

There is at least one more major error, but I need you to post more lines from the file cache to debug it.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

How this errors message?

Regards,
Rochmady