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

touch() missing permission cause warning #7

Closed
FMaz008 opened this issue Mar 19, 2011 · 5 comments
Closed

touch() missing permission cause warning #7

FMaz008 opened this issue Mar 19, 2011 · 5 comments
Labels

Comments

@FMaz008
Copy link
Contributor

FMaz008 commented Mar 19, 2011

Abstract:

Sometime when I run phpdox without sudo it, I'll receive 1 warning per file scanned:

Expected:

A human readable error explaining the situation instead of a debug error.

Actual result:

PHP Warning:  touch(): Utime failed: Operation not permitted in /var/www/phpdox/phpdox/src/processor.php on line 90
PHP Stack trace:
PHP   1. {main}() /var/www/phpdox/phpdox/phpdox.php:0
PHP   2. TheSeer\phpDox\CLI->run() /var/www/phpdox/phpdox/phpdox.php:69
PHP   3. TheSeer\phpDox\Processor->run() /var/www/phpdox/phpdox/src/cli.php:84
PHP   4. touch() /var/www/phpdox/phpdox/src/processor.php:90
@theseer
Copy link
Owner

theseer commented Mar 20, 2011

Do you have any scenario to reproduce that? For so far, i don't manage to get that...

@FMaz008
Copy link
Contributor Author

FMaz008 commented Mar 20, 2011

Not yet, but I'll try to investigate.
For now I can just say that I work on a NAS server, mounted in CIFS. So
maybe it's du to file permission or the file owner.

2011/3/20 theseer <
reply@reply.github.com>

Do you have any scenario to reproduce that? For so far, i don't manage to
get that...

Reply to this email directly or view it on GitHub:
#7 (comment)

Francois Mazerolle;

@FMaz008
Copy link
Contributor Author

FMaz008 commented Mar 26, 2011

Ok, I got the problem with the latest version too, here's all the data I've been able to gather so far:

PHP Warning:  touch(): Utime failed: Operation not permitted in /mnt/nas/www/phpdox/src/collector.php on line 96
PHP Stack trace:
PHP   1. {main}() /mnt/nas/www/phpdox/phpdox.php:0
PHP   2. TheSeer\phpDox\CLI->run() /mnt/nas/www/phpdox/phpdox.php:57
PHP   3. TheSeer\phpDox\Application->runCollector() /mnt/nas/www/phpdox/src/cli.php:96
PHP   4. TheSeer\phpDox\Collector->run() /mnt/nas/www/phpdox/src/application.php:93
PHP   5. touch() /mnt/nas/www/phpdox/src/collector.php:96

I got the error 5 times ( as there's 5 files in the tests/data/ folder )
File permission are:
drwxrwxrwx 2 502 502 0 2011-03-20 13:03 .
drwxrwxrwx 3 502 502 0 2011-03-20 13:03 ..
-rwxrwxrwx 1 502 502 17435 2011-03-20 13:03 test0.php
-rwxrwxrwx 1 502 502 28 2011-03-20 13:03 test1.php
-rwxrwxrwx 1 502 502 78 2011-03-20 13:03 test2.php
-rwxrwxrwx 1 502 502 47 2011-03-20 13:03 test3.php
-rwxrwxrwx 1 502 502 1548 2011-03-20 13:03 test4.php

The file system is CIFS. And the file listing is the one AFTER I try to ran phpdox. ( so the file update time is not modified ).

If I touch tests/data/test0.php , the file will be modified correctly:
fmaz@FMaz-Zino:/mnt/nas/www/phpdox$ touch tests/data/test0.php
fmaz@FMaz-Zino:/mnt/nas/www/phpdox$ ls -la tests/data/
total 36
drwxrwxrwx 2 502 502 0 2011-03-20 13:03 .
drwxrwxrwx 3 502 502 0 2011-03-20 13:03 ..
-rwxrwxrwx 1 502 502 17435 2011-03-25 22:51 test0.php
-rwxrwxrwx 1 502 502 28 2011-03-20 13:03 test1.php
-rwxrwxrwx 1 502 502 78 2011-03-20 13:03 test2.php
-rwxrwxrwx 1 502 502 47 2011-03-20 13:03 test3.php
-rwxrwxrwx 1 502 502 1548 2011-03-20 13:03 test4.php

Here's the full output of a normal execution :
fmaz@FMaz-Zino:/mnt/nas/www/phpdox$ ./phpdox.php tests/data/
phpdox %version% - Copyright (C) 2010 - 2011 by Arne Blankerts

PHP Warning:  touch(): Utime failed: Operation not permitted in /mnt/nas/www/phpdox/src/collector.php on line 96
PHP Stack trace:
PHP   1. {main}() /mnt/nas/www/phpdox/phpdox.php:0
PHP   2. TheSeer\phpDox\CLI->run() /mnt/nas/www/phpdox/phpdox.php:57
PHP   3. TheSeer\phpDox\Application->runCollector() /mnt/nas/www/phpdox/src/cli.php:96
PHP   4. TheSeer\phpDox\Collector->run() /mnt/nas/www/phpdox/src/application.php:93
PHP   5. touch() /mnt/nas/www/phpdox/src/collector.php:96
.PHP Warning:  touch(): Utime failed: Operation not permitted in /mnt/nas/www/phpdox/src/collector.php on line 96
PHP Stack trace:
PHP   1. {main}() /mnt/nas/www/phpdox/phpdox.php:0
PHP   2. TheSeer\phpDox\CLI->run() /mnt/nas/www/phpdox/phpdox.php:57
PHP   3. TheSeer\phpDox\Application->runCollector() /mnt/nas/www/phpdox/src/cli.php:96
PHP   4. TheSeer\phpDox\Collector->run() /mnt/nas/www/phpdox/src/application.php:93
PHP   5. touch() /mnt/nas/www/phpdox/src/collector.php:96
.PHP Warning:  touch(): Utime failed: Operation not permitted in /mnt/nas/www/phpdox/src/collector.php on line 96
PHP Stack trace:
PHP   1. {main}() /mnt/nas/www/phpdox/phpdox.php:0
PHP   2. TheSeer\phpDox\CLI->run() /mnt/nas/www/phpdox/phpdox.php:57
PHP   3. TheSeer\phpDox\Application->runCollector() /mnt/nas/www/phpdox/src/cli.php:96
PHP   4. TheSeer\phpDox\Collector->run() /mnt/nas/www/phpdox/src/application.php:93
PHP   5. touch() /mnt/nas/www/phpdox/src/collector.php:96
.PHP Warning:  touch(): Utime failed: Operation not permitted in /mnt/nas/www/phpdox/src/collector.php on line 96
PHP Stack trace:
PHP   1. {main}() /mnt/nas/www/phpdox/phpdox.php:0
PHP   2. TheSeer\phpDox\CLI->run() /mnt/nas/www/phpdox/phpdox.php:57
PHP   3. TheSeer\phpDox\Application->runCollector() /mnt/nas/www/phpdox/src/cli.php:96
PHP   4. TheSeer\phpDox\Collector->run() /mnt/nas/www/phpdox/src/application.php:93
PHP   5. touch() /mnt/nas/www/phpdox/src/collector.php:96
.PHP Warning:  touch(): Utime failed: Operation not permitted in /mnt/nas/www/phpdox/src/collector.php on line 96
PHP Stack trace:
PHP   1. {main}() /mnt/nas/www/phpdox/phpdox.php:0
PHP   2. TheSeer\phpDox\CLI->run() /mnt/nas/www/phpdox/phpdox.php:57
PHP   3. TheSeer\phpDox\Application->runCollector() /mnt/nas/www/phpdox/src/cli.php:96
PHP   4. TheSeer\phpDox\Collector->run() /mnt/nas/www/phpdox/src/application.php:93
PHP   5. touch() /mnt/nas/www/phpdox/src/collector.php:96
.

phpdox %version% - Copyright (C) 2010 - 2011 by Arne Blankerts

Error while processing request:
 - fDOMException: loading file './xml/tests/data/test4.php.xml' failed.

Details as follows:
[XML-STRING] [Line: 0 - Column: 0] Warning 1549: failed to load external entity "/mnt/nas/www/phpdox/xml/tests/data/test4.php.xml"

And here's the same command with sudo ( touch is no more a problem, but the xml file is still not generated) :

fmaz@FMaz-Zino:/mnt/nas/www/phpdox$ sudo ./phpdox.php tests/data/
[sudo] password for fmaz: 
phpdox %version% - Copyright (C) 2010 - 2011 by Arne Blankerts

.....

phpdox %version% - Copyright (C) 2010 - 2011 by Arne Blankerts

Error while processing request:
 - fDOMException: loading file './xml/tests/data/test4.php.xml' failed.

Details as follows:
[XML-STRING] [Line: 0 - Column: 0] Warning 1549: failed to load external entity "/mnt/nas/www/phpdox/xml/tests/data/test4.php.xml"

I've also notice that the first time I run the process (when the xml/ folder doesn't exist) the error will concern the test0.php.xml file. The next time, it will concern test4.php.xml.

Finally, here's the resulting content of the xml/ folder:

fmaz@FMaz-Zino:/mnt/nas/www/phpdox$ ls -la xml/
total 12
drwxrwxrwx 2 502 502    0 2011-03-25 23:01 .
drwxrwxrwx 7 502 502    0 2011-03-25 23:00 ..
-rwxrwxrwx 1 502 502 1180 2011-03-25 23:00 classes.xml
-rwxrwxrwx 1 502 502  307 2011-03-25 23:00 interfaces.xml
-rwxrwxrwx 1 502 502  370 2011-03-25 23:00 namespaces.xml

Note that now I can reproduce that behaviour at will.
Might be good to note that the uid/gid 502 are dummy. ( As my uid is 1000), but as the chmod is o+rw for all that drive, I didn't expect problem for accessing files, or at least, a human readable error ( Can't create test0.php.xml in xml/ , check folder permission )

I'll try to edit my fstab to have the uid:gid 1000:1000, and I'll come back with further information is anything is changed.

@FMaz008
Copy link
Contributor Author

FMaz008 commented Mar 26, 2011

Quick Update:
Adding the good uid/gid in the fstab to mount the CIFS filesystem fixed the touch problem. ( It now works well without sudo ) No more error is returned by the --collect step.

However, the --generate step still return the same test*.php.xml not found error.
If you want me to put some debug or make some specific tests, I'll be glad to do so.

@theseer
Copy link
Owner

theseer commented Mar 26, 2011

I've been searching for the touch issue on google and found various reports about it, all referring to permission problems on the filesystem. So i consider that a system setup problem, not a phpdox related bug.

Since there is about zero actual error checking and logging yet, this is for sure something that we'll fix from the reporting point of view.

I'll look into the other problem, but for tracking purposes, i'll close this bug and move the new problem over to a new bug :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants