Closed lukearmstrong closed 10 years ago
I have a symilar error in jenkins-php with Symfony2 project:
phpcb: [exec] PHP Warning: DOMDocument::loadHTML(): Validation failed: no DTD found !Validation failed: no DTD found !Validation failed: no DTD found !Validation failed: no DTD found !Invalid char in CDATA 0xC in Entity, line: 1 in /usr/share/php/PHP_CodeBrowser/View/ViewReview.php on line 410 [exec] PHP Stack trace: [exec] PHP 1. {main}() /usr/bin/phpcb:0 [exec] PHP 2. CbCLIController::main() /usr/bin/phpcb:56 [exec] PHP 3. CbCLIController->run() /usr/share/php/PHP_CodeBrowser/CLIController.php:409 [exec] PHP 4. CbViewReview->generate() /usr/share/php/PHP_CodeBrowser/CLIController.php:326 [exec] PHP 5. CbViewReview->_formatSourceCode() /usr/share/php/PHP_CodeBrowser/View/ViewReview.php:137 [exec] PHP 6. CbViewReview->_highlightCode() /usr/share/php/PHP_CodeBrowser/View/ViewReview.php:165 [exec] PHP 7. DOMDocument->loadHTML() /usr/share/php/PHP_CodeBrowser/View/ViewReview.php:410 [exec] PHP Warning: DOMDocument::loadHTML(): Invalid char in CDATA 0xB in Entity, line: 1 in /usr/share/php/PHP_CodeBrowser/View/ViewReview.php on line 410 [exec] PHP Stack trace: [exec] PHP 1. {main}() /usr/bin/phpcb:0 [exec] PHP 2. CbCLIController::main() /usr/bin/phpcb:56 [exec] PHP 3. CbCLIController->run() /usr/share/php/PHP_CodeBrowser/CLIController.php:409 [exec] PHP 4. CbViewReview->generate() /usr/share/php/PHP_CodeBrowser/CLIController.php:326 [exec] PHP 5. CbViewReview->_formatSourceCode() /usr/share/php/PHP_CodeBrowser/View/ViewReview.php:137 [exec] PHP 6. CbViewReview->_highlightCode() /usr/share/php/PHP_CodeBrowser/View/ViewReview.php:165 [exec] PHP 7. DOMDocument->loadHTML() /usr/share/php/PHP_CodeBrowser/View/ViewReview.php:410 [exec] PHP Warning: DOMDocument::loadHTML(): Invalid char in CDATA 0xC in Entity, line: 1 in /usr/share/php/PHP_CodeBrowser/View/ViewReview.php on line 410 [exec] PHP Stack trace: [exec] PHP 1. {main}() /usr/bin/phpcb:0 [exec] PHP 2. CbCLIController::main() /usr/bin/phpcb:56 [exec] PHP 3. CbCLIController->run() /usr/share/php/PHP_CodeBrowser/CLIController.php:409 [exec] PHP 4. CbViewReview->generate() /usr/share/php/PHP_CodeBrowser/CLIController.php:326 [exec] PHP 5. CbViewReview->_formatSourceCode() /usr/share/php/PHP_CodeBrowser/View/ViewReview.php:137 [exec] PHP 6. CbViewReview->_highlightCode() /usr/share/php/PHP_CodeBrowser/View/ViewReview.php:165 [exec] PHP 7. DOMDocument->loadHTML() /usr/share/php/PHP_CodeBrowser/View/ViewReview.php:410
Any resolution on this one?
Also experiencing this issue...
I'll look into it in the next days.
Doing some dirty debugging, I printed the filename in _highlightCode before the loadHTML call, which for me displayed following:
/Users/Shared/Jenkins/Home/jobs/test/workspace/build/api/css/bootstrap.min.css PHP Warning: DOMDocument::loadHTML(): Validation failed: no DTD found !Validation failed: no DTD found !Validation failed: no DTD found !Validation failed: no DTD found !Validation failed: no DTD found !Invalid char in CDATA 0xC in Entity, line: 1 in /Users/freddiekarlbom/pear/share/pear/PHP_CodeBrowser/View/ViewReview.php on line 410 [exec] PHP Stack trace: [exec] PHP 1. {main}() /Users/freddiekarlbom/pear/bin/phpcb:0 [exec] PHP 2. CbCLIController::main() /Users/freddiekarlbom/pear/bin/phpcb:56 [exec] PHP 3. CbCLIController->run() /Users/freddiekarlbom/pear/share/pear/PHP_CodeBrowser/CLIController.php:409 [exec] PHP 4. CbViewReview->generate() /Users/freddiekarlbom/pear/share/pear/PHP_CodeBrowser/CLIController.php:326 [exec] PHP 5. CbViewReview->_formatSourceCode() /Users/freddiekarlbom/pear/share/pear/PHP_CodeBrowser/View/ViewReview.php:137 [exec] PHP 6. CbViewReview->_highlightCode() /Users/freddiekarlbom/pear/share/pear/PHP_CodeBrowser/View/ViewReview.php:165 [exec] PHP 7. DOMDocument->loadHTML() /Users/freddiekarlbom/pear/share/pear/PHP_CodeBrowser/View/ViewReview.php:410 [exec] PHP Warning: DOMDocument::loadHTML(): Invalid char in CDATA 0xB in Entity, line: 1 in /Users/freddiekarlbom/pear/share/pear/PHP_CodeBrowser/View/ViewReview.php on line 410 [exec] PHP Stack trace: [exec] PHP 1. {main}() /Users/freddiekarlbom/pear/bin/phpcb:0 [exec] PHP 2. CbCLIController::main() /Users/freddiekarlbom/pear/bin/phpcb:56 [exec] PHP 3. CbCLIController->run() /Users/freddiekarlbom/pear/share/pear/PHP_CodeBrowser/CLIController.php:409 [exec] PHP 4. CbViewReview->generate() /Users/freddiekarlbom/Users/Shared/Jenkins/Home/jobs/test/workspace/build/api/css/jquery.iviewer.css/Users/Shared/Jenkins/Home/jobs/test/workspace/bu/pear/share/pear/PHP_CodeBrowser/CLIController.php:326 [exec] PHP 5. CbViewReview->_formatSourceCode() /Users/freddiekarlbom/pear/share/pear/PHP_CodeBrowser/View/ViewReview.php:137 [exec] PHP 6. CbViewReview->_highlightCode() /Users/freddiekarlbom/pear/share/pear/PHP_CodeBrowser/View/ViewReview.php:165 [exec] PHP 7. DOMDocument->loadHTML() /Users/freddiekarlbom/pear/share/pear/PHP_CodeBrowser/View/ViewReview.php:410 [exec] PHP Warning: DOMDocument::loadHTML(): Invalid char in CDATA 0xC in Entity, line: 1 in /Users/freddiekarlbom/pear/share/pear/PHP_CodeBrowser/View/ViewReview.php on line 410 [exec] PHP Stack trace: [exec] PHP 1. {main}() /Users/freddiekarlbom/pear/bin/phpcb:0 [exec] PHP 2. CbCLIController::main() /Users/freddiekarlbom/pear/bin/phpcb:56 [exec] PHP 3. CbCLIController->run() /Users/freddiekarlbom/pear/share/pear/PHP_CodeBrowser/CLIController.php:409 [exec] PHP 4. CbViewReview->generate() /Users/freddiekarlbom/pear/share/pear/PHP_CodeBrowser/CLIController.php:326 [exec] PHP 5. CbViewReview->_formatSourceCode() /Users/freddiekarlbom/pear/share/pear/PHP_CodeBrowser/View/ViewReview.php:137 [exec] PHP 6. CbViewReview->_highlightCode() /Users/freddiekarlbom/pear/share/pear/PHP_CodeBrowser/View/ViewReview.php:165 [exec] PHP 7. DOMDocument->loadHTML() /Users/freddiekarlbom/pear/share/pear/PHP_CodeBrowser/View/ViewReview.php:410 [exec] ild/api/css/prettify.css/Users/Shared/Jenkins/Home/jobs/test/workspace/build/api/css/template.css
Since it seems to be part of api generation, I guess it might be a problem related to the phpDocumentor installation? I use the latest phpdocumentor2 (http://www.phpdoc.org/) installation, since I need it to work with php 5.3.
Is it possible that your files are not in latin1 or UTF-8?
I cloned fuel/fuel and tried phpcb on it, there were no errors. Do you have any idea how I could reproduce that?
Another thing worth trying: go to src/ViewReview.php and change the following lines (line numbers refer to 1.0.3) to include the 'u' parameter in the regex.
Around 401:
$sourceCode = preg_replace(
'/^.*$/m', '<li>$0</li>',
htmlentities($sourceCode)
);
change to
$sourceCode = preg_replace(
'/^.*$/mu', '<li>$0</li>',
htmlentities($sourceCode)
);
And right below, on line 405
$sourceCode = preg_replace('/ /', ' ', $sourceCode);
to
$sourceCode = preg_replace('/ /u', ' ', $sourceCode);
Adding the u-flag to the regex didn't change anything in the output.
Running
find . -type f -exec file --mime {} \; | grep -v "charset=utf-8\|charset=us-ascii"
lists many files with charset binary, among them image files, .css, .ttf, .zip and .mysql files.
When excluding binary charset as well, the command lists
./build/api/js/prettify/lang-apollo.js: text/plain; charset=iso-8859-1
./build/api/js/prettify/lang-go.js: text/plain; charset=iso-8859-1
./build/api/js/prettify/lang-lua.js: text/plain; charset=iso-8859-1
./build/api/js/prettify/lang-ml.js: text/plain; charset=iso-8859-1
./build/api/js/prettify/lang-scala.js: text/plain; charset=iso-8859-1
./build/api/js/prettify/lang-sql.js: text/plain; charset=iso-8859-1
./build/api/js/prettify/lang-tex.js: text/plain; charset=iso-8859-1
./build/api/js/prettify/lang-vb.js: text/plain; charset=unknown-8bit
./build/api/js/prettify/lang-vhdl.js: text/plain; charset=iso-8859-1
./build/api/js/prettify/lang-wiki.js: text/plain; charset=iso-8859-1
where ./build/api/js/prettify/lang-vb.js: text/plain; charset=unknown-8bit sticks out.
For me at least, it seems the problem might be related to the project structure, as the source by default was the same as the basedir, where documentation was generated (based on this tutorial for setting it up together with CI: http://blog.famakinwa.net/content/getting-codeigniter-phpunit-and-jenkins-working-together ). When configuring the phpcb --source so it doesn't read any of the files with other encoding than utf-8 and us-ascii ( --source ${basedir}/application instead of ${basedir} in the build-file) the error goes away.
Could you just exclude "lang-vb.js"? Codebrowser tries to detect the encoding, maybe it fails in a weird way here.
+1
phpcb:
[exec] PHP Warning: DOMDocument::loadHTML(): Validation failed: no DTD found !Validation failed: no DTD found !Validation failed: no DTD found !Validation failed: no DTD found !Invalid char in CDATA 0x1B in Entity, line: 2 in /usr/share/pear/PHP_CodeBrowser/View/ViewReview.php on line 272
[exec] PHP Stack trace:
[exec] PHP 1. {main}() /usr/bin/phpcb:0
[exec] PHP 2. CbCLIController::main() /usr/bin/phpcb:56
[exec] PHP 3. CbCLIController->run() /usr/share/pear/PHP_CodeBrowser/CLIController.php:409
[exec] PHP 4. CbViewReview->generate() /usr/share/pear/PHP_CodeBrowser/CLIController.php:326
[exec] PHP 5. CbViewReview->_formatSourceCode() /usr/share/pear/PHP_CodeBrowser/View/ViewReview.php:137
[exec] PHP 6. CbViewReview->_highlightCode() /usr/share/pear/PHP_CodeBrowser/View/ViewReview.php:165
[exec] PHP 7. CbViewReview->_highlightPhpCode() /usr/share/pear/PHP_CodeBrowser/View/ViewReview.php:364
[exec] PHP 8. DOMDocument->loadHTML() /usr/share/pear/PHP_CodeBrowser/View/ViewReview.php:272
I'm currently experiencing the same issues as highlighted above. Does anyone have a solution?
can verify this issue is still relevant as of dev-master#93318ce
Should be fixed in #27
I'm getting this error on version 1.1.2
is this a regression?
Could you try this with the branch above, and report back please?
Hi again, the branch works fine and version 1.1.2 now works too, I cannot replicate the bug after downgrading to 1.1.1 and clearing vendor folder.
The steps where the following:
"mayflower/php-codebrowser": "~1.1"
After downgrading to version 1.1.1 everything worked again.
Probably was an isolated problem, let me know if you need any more info.
Same issue here. Upgraded to 1.1.2 and got the error.A Downgrade resolved the problem
Guys, i made a downgrade, and the issue still persists, any clue on what i'm missing ?
I followed the guide at http://jenkins-php.org/ and am getting this error. It still seems to work though, as the Code Browser link in Jenkins works.
I am attempting to run it on fuel/fuel using this version of PHP_CodeBrowser