Modify

Opened 8 years ago

Closed 8 years ago

#12758 closed defect (worksforme)

Error saying "HTMLDOC is not installed" even though it is

Reported by: anonymous Owned by: Diorgenes Felipe Grzesiuk
Priority: normal Component: TracWikiToPdfPlugin
Severity: normal Keywords:
Cc: Trac Release: 1.0

Description

TrackWikiToPdfPlugin is installed via the easy_install method and is showing up and enabled in the admin section.

When I click to create a PDF/HTML/PS I get the error "HTMLDOC is not installed" although it is.

The system is FreeBSD 10.3 totally up to date and running the latest available versions of all programs (packages). Version of Trac in use is 1.0.9.

test:/ # htmldoc --version
1.8.28
test:/ # python
Python 2.7.11 (default, Jan 20 2016, 15:37:30)
[GCC 4.2.1 Compatible FreeBSD Clang 3.4.1 (tags/RELEASE_34/dot1-final 208032)] on freebsd10
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
>>> subprocess.Popen(('htmldoc', '--version'), stdout=subprocess.PIPE).communicate()[0]
'1.8.28\n'
>>>

Any help getting this working would be greatly appreciated!

Attachments (0)

Change History (19)

comment:1 Changed 8 years ago by Ryan J Ollos

Maybe we can log the exception and get more information: browser:/tracwikitopdfplugin/0.11/wikitopdf/wikitopdf.py@11507:180,182,183#L174.

-    except OSError:
-        raise TracError("HTMLDOC is not installed.")
+    except OSError, e:
+        env.log.error("Error checking htmldoc version: %s", e)
+        raise TracError("HTMLDOC is not installed.")
Last edited 8 years ago by Ryan J Ollos (previous) (diff)

comment:2 Changed 8 years ago by anonymous

Thanks for the answer but I now get the error

Trac detected an internal error:
NameError: global name 'self' is not defined
Python Traceback

Most recent call last:
File "/usr/local/lib/python2.7/site-packages/trac/web/main.py", line 554, in _dispatch_request
File "/usr/local/lib/python2.7/site-packages/trac/web/main.py", line 247, in dispatch
File "/usr/local/lib/python2.7/site-packages/trac/admin/web_ui.py", line 119, in process_request
File "build/bdist.freebsd-10.3-RELEASE-amd64/egg/wikitopdf/web_ui.py", line 68, in render_admin_panel
File "build/bdist.freebsd-10.3-RELEASE-amd64/egg/wikitopdf/formats.py", line 52, in process_wikitopdf
File "build/bdist.freebsd-10.3-RELEASE-amd64/egg/wikitopdf/wikitopdf.py", line 183, in html_to_pdf

comment:3 Changed 8 years ago by Ryan J Ollos

That patch was untested. I modified the patch in comment:1 after looking at the code again. Please try with the latest patch in comment:1.

comment:4 Changed 8 years ago by anonymous

Made the change and this is what I get in the error log:

Apr 29 15:21:53 noc Trac[wikitopdf] ERROR: Error checking htmldoc version: [Errno 2] No such file or directory
Apr 29 15:21:53 noc Trac[main] WARNING: [107.202.12.23] HTTPInternalError: 500 Trac Error (HTMLDOC is not installed.)

comment:5 Changed 8 years ago by Ryan J Ollos

Maybe check where htmldoc is installed relative to the Trac egg. It might be that htmldoc is not on the path of the user under such the Trac process is running. Are you running TracStandalone or a Web server?

comment:6 Changed 8 years ago by Ryan J Ollos

In 15520:

2.3.2: Use exception message when raising TracError

Remove tag_svn_revision attribute from setup.cfg. The
attribute isn't supported in setuptool >= 10.

Refs #12758.

comment:7 Changed 8 years ago by anonymous

Trac is running under apache as the user www which has access to run htmldoc

test:~ # su -m www
test:~ $ which htmldoc
/usr/local/bin/htmldoc
test:~ $ htmldoc
HTMLDOC Version 1.8.28 Copyright 1997-2010 Easy Software Products. All rights reserved.
This software is based in part on the work of the Independent JPEG Group.
...

comment:8 Changed 8 years ago by Ryan J Ollos

In 15531:

2.3.3dev: Replace tabs with spaces

Refs #12758.

comment:9 Changed 8 years ago by Ryan J Ollos

In 15532:

2.3.3dev: Add option for setting path to HTMLDOC binary

Refs #12758.

comment:10 Changed 8 years ago by Ryan J Ollos

In 15533:

2.3.3dev: Don't interpolate strings passed to logger

Refs #12758.

comment:11 Changed 8 years ago by Ryan J Ollos

After [15532], you could try setting the path to the HTMLDOC binary:

[wikitopdf]
htmldoc_path = /usr/local/bin/htmldoc

comment:12 Changed 8 years ago by anonymous

Thanks. Got a little farther... I now get the error:

Trac Error
OSError: [Errno 2] No such file or directory

and essentially the same thing in the log file.

Here's the relevant section from trac.ini:

[wikitopdf]
base_dir = /home/trac
folder_name = EXAMPLE
htmldoc_path = /usr/local/bin/htmldoc
link = https://example.com/example/
tmp_dir = /tmp

comment:13 Changed 8 years ago by Ryan J Ollos

In 15539:

Copy 0.11 branch to create 1.0 branch

Refs #6604, #12758.

comment:14 Changed 8 years ago by Ryan J Ollos

There's a 1.0 branch now that adds additional changes described in #6604.

I'm not familiar with FreeBSD, but I can only imagine that this is somehow a permissions issue.

comment:15 Changed 8 years ago by anonymous

I've tried everything I can possibly think of but still get the error. Not sure what else to try but I'll keep at it. Thanks for the help getting it this far.

comment:16 in reply to:  7 Changed 8 years ago by Ryan J Ollos

Replying to anonymous:

Trac is running under apache as the user www which has access to run htmldoc

Are you running with mod_wsgi or mod_python?

comment:17 Changed 8 years ago by Ryan J Ollos

You could try running TracStandalone to see if it works with that configuration.

comment:18 Changed 8 years ago by anonymous

Well, it suddenly decided to work. I've tried several things so not sure what it ended up being in the end but it does work now. Thanks for the help, I really appreciate it!

comment:19 Changed 8 years ago by Ryan J Ollos

Resolution: worksforme
Status: newclosed

Good news!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Diorgenes Felipe Grzesiuk.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.