Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lizmap logs - persistent warning #2692

Closed
josemvm opened this issue Jan 13, 2022 · 8 comments
Closed

lizmap logs - persistent warning #2692

josemvm opened this issue Jan 13, 2022 · 8 comments
Assignees
Labels
bug feedback stale This ticket might be closed soon
Milestone

Comments

@josemvm
Copy link
Collaborator

josemvm commented Jan 13, 2022

What is the bug?

persistent warning as relevant log output

Steps to reproduce the issue

load a project

Lizmap version

3.4.8

QGIS desktop version

3.16.15

QGIS server version

3.16.15

Operating system

Ubuntu 20.04

Browsers

Firefox

Browsers version

Firefox 95.0.2

Relevant log output

2022-01-13 20:49:52	xxx.xxx.xxx.xxx warning	2022-01-13 20:49:52	[2]	touch(): Utime failed: Operation not permitted	/var/www/html/lizmap-web-client-3.4.8/lib/jelix-plugins/cache/file/file.cache.php	189

2022-01-13 20:49:52	xxx.xxx.xxx.xxx	warning	2022-01-13 20:49:52	[2]	touch(): Utime failed: Operation not permitted	/var/www/html/lizmap-web-client-3.4.8/lib/jelix-plugins/cache/file/file.cache.php	183
@josemvm josemvm added the bug label Jan 13, 2022
@josemvm josemvm added this to the 3.4.9 milestone Jan 13, 2022
@laurentj
Copy link
Collaborator

Verify that there are enough rights into lizmap/var/cache/ to be modified by the user who runs PHP (most of time, www-data on linux).

The class inside file.cache.php is called each time Lizmap want to store some cache into files. Without a stack trace, I cannot know if there is a bug somewhere.

@josemvm
Copy link
Collaborator Author

josemvm commented Jan 27, 2022

it seems the cache directory is missing from a fresh installation...
i just created it now and the warning is gone

@josemvm
Copy link
Collaborator Author

josemvm commented Jan 27, 2022

i can confirm from another installation, the folder is not created at the moment of lizmap installation

@Gustry Gustry removed the feedback label Jan 27, 2022
@Gustry Gustry modified the milestones: 3.4.9, 3.4.10 Feb 4, 2022
@Gustry Gustry modified the milestones: 3.4.10, 3.4.11 Mar 24, 2022
@Gustry
Copy link
Member

Gustry commented Apr 12, 2022

I also got the issue, I was trying a quick fix to raise a better warning with the folder name for instance :

diff --git a/lib/installwizard/jtpl/locales/en.php b/lib/installwizard/jtpl/locales/en.php
index d89a49bad..670d492f5 100644
--- a/lib/installwizard/jtpl/locales/en.php
+++ b/lib/installwizard/jtpl/locales/en.php
@@ -3,7 +3,8 @@
 jTplConfig::$localizedMessages =array(
     'file.directory.notexists'=>'The directory (%s) doesn\'t exist',
     'file.directory.notwritable'=>'Impossible to write into the file %s, verify that rights are enabled',
-    'file.write.error'=>'A problem has occured during the writing of the file %s by using the temporary file %s',
+    'file.write.error'=>'A problem has occurred during the writing of the file %s by using the temporary file %s',
+    'directory.write.error'=>'A problem has occurred during the writing of the directory %s',
 
     'errors.tpl.tag.syntax.invalid'=>'In the template %2$s, invalid syntax on tag %1$s',
     'errors.tpl.tag.function.invalid'=>'In the template %2$s, invalid syntax on the function %1$s',
diff --git a/lib/jelix/utils/jFile.class.php b/lib/jelix/utils/jFile.class.php
index 182a144e1..9ea9631eb 100644
--- a/lib/jelix/utils/jFile.class.php
+++ b/lib/jelix/utils/jFile.class.php
@@ -94,7 +94,15 @@ class jFile {
         // so should do own recursion
         if (!file_exists($dir)) {
             self::createDir(dirname($dir), $chmod);
+            if (!file_exists(dirname($dir))){
+                // Not enough rights to create the parent directory
+                throw new jException('jelix~errors.directory.write.error', dirname($dir));
+            }
             mkdir($dir, ($chmod?$chmod:jApp::config()->chmodDir));
+            if (!file_exists($dir)){
+                // Not enough rights to create the parent directory
+                throw new jException('jelix~errors.directory.write.error', $dir);
+            }
             // php mkdir apply umask on the given mode, so we must to
             // do a chmod manually.
             chmod($dir, ($chmod?$chmod:jApp::config()->chmodDir));

@laurentj
Copy link
Collaborator

the folder is not created

Which folder? I said a wrong thing in my last comment: lizmap/var/cache/ is not used by Lizmap. By default it is temp/lizmap/www/cache. It the missing folder is lizmap/var/cache/ , so it is because you indicated it yourself into the var/config/profiles.ini.php (cache_dir of the jcache:myapp section?). If you indicated it yourself, you must then create the directory and set rights on it. The cache plugin try to create it, but most of time, the PHP process has no rights on the var/ directory.

@Gustry Gustry modified the milestones: 3.4.11, 3.4.12 Apr 29, 2022
@Gustry Gustry modified the milestones: 3.4.12, 3.4.13 Jul 1, 2022
@Gustry Gustry modified the milestones: 3.4.13, 3.4.14 Sep 20, 2022
@josemvm
Copy link
Collaborator Author

josemvm commented Sep 26, 2022

@laurentj this warning persists on version 3.5.6
my cache_dir parameter is cache_dir=

@Gustry Gustry modified the milestones: 3.4.14, 3.5.8 Oct 18, 2022
@Gustry Gustry modified the milestones: 3.5.8, 3.5.9 Dec 8, 2022
@Gustry Gustry modified the milestones: 3.5.9, 3.5.10, 3.5.11 Jan 23, 2023
@Gustry Gustry removed this from the 3.5.11 milestone Feb 28, 2023
@Gustry Gustry added this to the 3.5.12 milestone Feb 28, 2023
@Gustry Gustry modified the milestones: 3.5.12, 3.5.13 Apr 12, 2023
@Gustry Gustry modified the milestones: 3.5.13, 3.5.14 May 30, 2023
@Gustry Gustry modified the milestones: 3.5.14, 3.5.15 Jul 31, 2023
@Gustry Gustry modified the milestones: 3.5.15, 3.5.16 Oct 3, 2023
@Gustry Gustry modified the milestones: 3.5.16, 3.5.17 Oct 11, 2023
@Gustry Gustry modified the milestones: 3.5.17, backlog 3.5 Nov 20, 2023
@nboisteault
Copy link
Member

Does issue still occur?

Copy link

This issue is missing some feedbacks. 👻
Please have a look to the discussion, thanks. 🦎

@github-actions github-actions bot added the stale This ticket might be closed soon label Jan 23, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug feedback stale This ticket might be closed soon
Projects
None yet
Development

No branches or pull requests

4 participants