PDF export is not working

When I export my overview to PDF I get the error message HTTP 404 Not Found: The webpage cannot be found. I’ve searched the Forum and I found some articles with this issue. You need to execute a command line instruction somewhere in a folder ./wkhtmltopdf-i386. However, I bought scriptcase because I only have FTP access to the production server. Therefore I cannot use these solutions (and due to Scriptcase you only need FTP access!).

So, my question is: when will this bug be solved. I need to inform my client on this, they want to use PDF export.

Hope to hear soon.

Regards,

Marcel Besteman
(Netherlands)

[QUOTE=marcelbesteman;31158]When I export my overview to PDF I get the error message HTTP 404 Not Found: The webpage cannot be found. I’ve searched the Forum and I found some articles with this issue. You need to execute a command line instruction somewhere in a folder ./wkhtmltopdf-i386. However, I bought scriptcase because I only have FTP access to the production server. Therefore I cannot use these solutions (and due to Scriptcase you only need FTP access!).

So, my question is: when will this bug be solved. I need to inform my client on this, they want to use PDF export.

Hope to hear soon.

Regards,

Marcel Besteman
(Netherlands)[/QUOTE]

I’m not sure because didn’t happened to me, but did you tried to configure paths in prod enviroment? I think is related.

Marcel,

on your server at <your projekt>/_lib/prod/third/wkhtmltopdf/linux-i386 set the file wkthmltopdf-i386 to 755 and/or …wkthmltopdf/linux-amd64 the file wkhtmltopdf-amd64 also (this depends of your server processor).

HTH.

Hi,
did you receive any updates about this very annoying problem ?? I’m still have the needing of it working as expected also in a not dedicated service.
Run EXE file within a hosting server is , most of times, forbidden…
Bye

[QUOTE=giovannino;31391]Hi,
did you receive any updates about this very annoying problem ?? I’m still have the needing of it working as expected also in a not dedicated service.
Run EXE file within a hosting server is , most of times, forbidden…
Bye[/QUOTE]

Did you give execution permissions as Reinhard suggest?

Hi,
I put all interested directories also to 777 without any success.
They are more than 3 years I got this problem.
I tested on Aruba, and if I’m not wrong also on Altervista.

Hi all,

I still have the problem. On all of my environments (development, acceptance and production) I cannot export to PDF. For the development environment I’ve used the standard Scriptcase installer. I haven’t made any modifications to path settings etc. After checking the access rights I found out that the scriptcase/prod/third/wkhtmltopdf/linux-i386 has 777 rights. (In fact all the directories below /prod/third have 777 rights).

Now, the only difference I see with my situation compared with the comments of RHS (Reinhard) is that my third directory is not stored in <my project>/_lib/prod/ but in wwwroot/scriptcase/prod/third/. Is that an issue? These paths were created with the Scriptcase installer so I assume I should work at least on my development environment.

Any suggestions?

Regards,

Marcel Besteman
(Netherlands)

I have the same issue - Linux all rights are correct. PDF never gets generated. It says it does but the file is not in the tmp folder.
I have a windows dev environment and it does works as I have tested it. So anyone else have this issue on Linux? I believe this
could be just a run issue on commercial linux shared hosting systems? - no rights to run a bin from the user account ?

Any ideas?

Try use Hoo.st, to host your projects, and/or scriptcase.

The pdf work! And have a great support!

John, you add nothing to this forum except promoting a hosting party which obviously is yours or you’re working at. I’m at the point of banning you. I already had a big discussion regarding your spamming messages on my email and I still receive them.

If you can check your apache log or your php error logging they might reveal some more info… I dont know how it goes with your particular server but you should normally be able to view them.

This is my apache log

[Sat Jan 24 14:20:50.535777 2015] [:error] [pid 9795] [client 2.235.120.77:51580] PHP Notice: Undefined variable: int_step in /var/www/html/prod/cmdb/grid_ci/grid_ci_gauge_ctrl.php on line 64, referer: https://xxxxxxxxxx/cmdb/grid_ci/grid_ci_iframe.php?scsess=li82u486crjmflf5os4aebsjq3&str_tmp=/cmdb/_lib/tmp&str_prod=/cmdb/_lib/prod&str_btn=scriptcase8_ceropegia/scriptcase8_ceropegia.css&str_lang=en_us&str_schema=Sc8_Ceropegia/Sc8_Ceropegia&script_case_init=1&script_case_session=li82u486crjmflf5os4aebsjq3&pbfile=%2Fvar%2Fwww%2Fhtml%2Fprod%2Fcmdb%2F_lib%2Ftmp%2Fsc_pb_li82u486crjmflf5os4aebsjq3.tmp&jspath=%2Fcmdb%2F_lib%2Fprod%2Flib%2Fjs&sc_apbgcol=%2Fvar%2Fwww%2Fhtml%2Fprod%2Fcmdb%2F_lib%2Fcss%2F&sc_tp_pdf=cor&sc_parms_pdf=%20%20--page-size%20Letter%20--orientation%20Portrait&sc_graf_pdf=S

[Sat Jan 24 14:20:53.691978 2015] [:error] [pid 9795] [client 2.235.120.77:51580] PHP Warning: readfile(/var/www/html/prod/cmdb/_lib/tmp/sc_pdf_20150124132046_127_grid_ci.pdf): failed to open stream: No such file or directory in /var/www/html/prod/cmdb/grid_ci/grid_ci_download.php on line 31, referer: https://xxxxxxxxxx/cmdb/grid_ci/grid_ci_iframe.php?scsess=li82u486crjmflf5os4aebsjq3&str_tmp=/cmdb/_lib/tmp&str_prod=/cmdb/_lib/prod&str_btn=scriptcase8_ceropegia/scriptcase8_ceropegia.css&str_lang=en_us&str_schema=Sc8_Ceropegia/Sc8_Ceropegia&script_case_init=1&script_case_session=li82u486crjmflf5os4aebsjq3&pbfile=%2Fvar%2Fwww%2Fhtml%2Fprod%2Fcmdb%2F_lib%2Ftmp%2Fsc_pb_li82u486crjmflf5os4aebsjq3.tmp&jspath=%2Fcmdb%2F_lib%2Fprod%2Flib%2Fjs&sc_apbgcol=%2Fvar%2Fwww%2Fhtml%2Fprod%2Fcmdb%2F_lib%2Fcss%2F&sc_tp_pdf=cor&sc_parms_pdf=%20%20--page-size%20Letter%20--orientation%20Portrait&sc_graf_pdf=S

Permissions are 777 to all files\subdirs in cmdb/

I checked the cmdb/_lib/tmp tmp dir and there is a file named sc_pdf_20150124132046_127_grid_ci.log that contains only this line:

./wkhtmltopdf-amd64 --page-size Letter --orientation Portrait --header-right “[page]” --javascript-delay 2000 http://xxxxxxxxxx/cmdb/_lib/tmp/sc_grid_ci_html_li82u486crjmflf5os4aebsjq3.html /var/www/html/prod/cmdb/_lib/tmp/sc_pdf_20150124132046_127_grid_ci.pdf

But the file /var/www/html/prod/cmdb/_lib/tmp/sc_pdf_20150124132046_127_grid_ci.pdf doensn’t get created.

One question: could the problem be that the current path prepended to “./wkhtmltopdf-amd64” at execution is the wrong one and an absolute path should be used instead?

Is not really necessary … Look at post #3 and try that.

From a website:
PHP has a directive named open_basedir which permit to limit the access on filesystem to specified directory-tree.

For example if you have in your php.ini:

open_basedir = /srv/http/:/home/:/tmp/
and you will access the file /filepath/filename.php, then you must set:

open_basedir = /srv/http/:/home/:/tmp/:/filepath/
otherwise PHP will not be able to access the file.

In this way that will allow all PHP code running on this machine to access /filepath/ directory-tree, so it is not secure for production environment. The better way is to set virtual-host based open_basedir in httpd.conf. I let you check your HTTP server documentation and also open_basedir documentation for that.

From another website:
set default permission to u r directory (i.e rwx) using setfacl command

ex: setfacl -d -m o::rwx your/directory/path
then any thing u create in that directory it takes rwx permission.

Just checked my system php.ini and [open_basedir] directive was remmed out
Added the apache www root to it, restarted apache, but to no avail.

I just retested it in the following scenario:

  • SC8 installed on Centos 7 via the NettMake provided automatic installer for Linux.
  • App created
  • App tested by running it directly from SC and it can export to PDF
  • App is deployed on the [B]same [/B] server via SC "Deploy on a server directory" option (target directory is outside scriptcase /opt/NetMake/v8 root)
  • Permissions reset to 777 to the whole dir tree of the deployed app <-- this is full access to everyone, so AFAIK no other permission level can "improve" it
  • Deployed app is used via Centos standard apache install on the same server and everything seems to wok fine and is now able to create a PDF file, but... the PDF file contains only the following line:

    “You don’t have permission to access
    /cmdb/_lib/tmp/sc_grid_site_html_0lh4hbtjvehono69s86o563n25.html on this server.”

File /var/www/html/prod/cmdb/_lib/tmp/sc_grid_site_html_0lh4hbtjvehono69s86o563n25.html actually does exist and its permission level is 777!
But I wonder if by using /cmdb… it means it’s looking for a cmdb dir located in the file system root (/).
In that case the error description is misleading because that dir doesn’t exist in the root as it’s actually inside my apache root (/var/www/html/prod/cmdb).
So I still wonder if there’s an absolute\relative path issue.
If not, I have no idea…

I created a link so that any process trying to access /cmdb could do it:

ln -s /var/www/html/prod/cmdb /cmdb

But nothing changes so I guess it is not a path issue.

Your PHP … is that mod_php or FastCGI in Apache? In my environment (FastCGI) i’am set only the rights as mentioned in post #3.

robydago,

try this:

  1. Try to export the pdf (so that it will create the .log file in tmp).

  2. Log into your server and cd to the directory /var/www/html/cmdb/_lib/tmp

  3. cat the .log file that you find there

  4. copy the line from the file, and paste it into your console exactly as-is and hit return. (This may give you an error)

  5. edit your command line and change “http://<path>/cmdb/_lib/tmp/<filename>.html” to “/var/www/html/cmdb/_lib/tmp/<filename>.html” and execute the new command line.

If after doing this you actually have a usable pdf file, then the problem is a CentOS configuration problem. Let me know, and I will walk you through fixing it.

If you still do not have a usable pdf -

  1. cat the .log file again and copy the http url, and go to a browser on your pc and try to download the .html file and see if it lets you, and tell us what happens.

Dave

Dave,

thanks for the hint.

  1. copy the line from the file, and paste it into your console and execute it. (This will probably give you an error)

I got this:

Loading pages (1/6)
Counting pages (2/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done
Exit with code 1 due to http error: 403 Forbidden

So I changed my apache config to allow unauthenticated http access (it was authenticated and HTTPS only before) and while it gave me an error at the end

Loading pages (1/6)
Counting pages (2/6)
Resolving links (4/6)
Loading headers and footers (5/6)
Printing pages (6/6)
Done
Exit with code 2 due to http error: 404 Page not found

it actually created the PDF file with the correct content.

  1. edit your command line and change “http://<path>/cmdb/_lib/tmp/<filename>.html” to “/var/www/html/cmdb/_lib/tmp/<filename>.html” and execute the new command line.

Using the local filepath instead of the HTTP URL, the file is created as well and without the http errors at the end.

Since I need to enable Authentication\HTTPS again, what’s the best way to solve this issue? Enabling HTTP\Unauthenticated from localhost and HTTPS\authenticated from anywhere else in the apache config (I wish I knew how… :slight_smile: …)?

Btw, why is SC using an http URL and not a local file path? Is there any way to tell SC to use the localpath? That would solve the issue without having to reconfigure apache, right?

Thanks again Dave.

Reinhard,
I think is mod_php, but anyway: 777 allows more access than 755, even if 777 is not needed and everything works with 755, using 777 cannot cause any issue.

Thanks.