wkhtmltopdf hangs on 10% and does not generate PDF - pdf

I'm using WKHtmlToPdf to generate some docs here at work, in internal applications, for over one and half year without any problem. Some applications are coded in C++, some in AutoIt3, and today, after restarting all the computers due to external reasons (power generator would be tested), wkhtmltopdf stopped working on all machines at my company.
I can't even run it from command line. Whether I try to convert a webpage or a local HTML file, it always hangs on 10%. All our machines are Windows 8 32 bits and runs their own install (the applications aren't running under a network share).
I tried downloading wkhtmltopdf again from the website, installing it, etc, but nothing worked. I also tried adding --disable-javascript option, which also didn't work. Cleaning %TEMP% folder did not help too.
I never faced anything like this. All the machines were restarted normally, going to start menu, etc. And it does not look like a network issue, since I'm accessing internet to write this, and we are a small company, we use a standard Wi-Fi router, just like your house. Nothing was changed, no file deleted, no Windows update, no network settings... just a restart. I saw some guys facing the same problem when trying to run wkhtmltopdf from PHP, but in this case, I have this problem even by running it from DOS, as anyone would do.
wkhtmltoimage is working fine. Just wkhtmltopdf stopped working.
Screenshot

In my case, wkhtmltopdf was hanging on files locally stored after the progress counter had made an initial jump to the percentage corresponding to 1 page. It turned out that I had an http_proxy variable set to some unaccessible proxy server. Clearing this environment variable solved the issue.

Related

NW.js app can't connect to specific web domain and that happens only on one single laptop

After thinking about this for 2 weeks, I have to ask this question.
I've created a NW.js app that works smoothly and nice on 7 different laptops and PCs. The app shows html videos and contains a bunch of javascripts, I've got deloped since 2 years. Alls this works fine on every laptop/PC.
Here comes the problem:
On one laptop the app works, too, but the app isn't able neither to show HTML frame contents nor to execute js scripts from a specific web domain. This only occurs with a specific domain (that I'm the owner of).
The strange thing is, that this happens only on one laptop.
The laptop uses the same internet connection as some other devices. I reinstalled the app, deleted all subfolders from the app folder, but the error is back. In the frame I see the silly message, that the website is down or moved.
You likely have a system-wide proxy configured or possibly some AV software installed on that laptop is blocking that site. Attempt to access the same URL through another browser (Chrome, Edge, Firefox, etc.) to confirm.
Could be related to your hosts file.
C:\Windows\System32\drivers\etc\hosts
That is a plain text file without an extension. You can put URL's or IP addresses in it and it will block any access to them globally on the computer.
Though Sysrage is probably right, it's more likely that you just have some AV/firewall/security software blocking stuff it shouldn't (happens all the time, they can be "over protective" sometimes)
If it is something related to your NW.js install, and it isn't happening on other machines (so you know your app code is correct), then you could try deleting the app data folder for you app. To find it's location on the computer run console.log(nw.App.dataPath). It should be something like:
C:\Users\YOUR USER NAME\AppData\Local\YOUR APP NAME
You can just delete the whole folder (make sure your app isn't running first). Then the next time you open your app it will recreate that folder (it's a chromium thing). Things like saved passwords or dev tool customization or spellcheck dictionary modifications are stored in there. So maybe there's just something funky that needs cleared out.

Remote web server pages do not update after making changes via SSHFS

I've been troubleshooting this for a while now and can't seem to find a solution. I have a remote LAMP server in my office and sometimes need to work from home. I use a SSHFS between my home computer and work to accomplish this.
However, I have run into an issue where when I update the local files, the changes get pushed to the server immediately as they should. I have verified that the changes are there via SSH and VIM. However, if I refresh and even force refresh the page in Chrome the changes do not appear.
I also created a local file which showed up immediately on the server and I could view in Chrome, but any subsequent changes to the file are not rendered.
Any time that I'm in the office the changes are rendered immediately as well.
Anybody have any ideas?
Apache 2.4.7
Sublime Text 3 Editor
Client SSHFS: win-sshfs 0.0.1.5
Server SSH: OpenSSH_6.6.1p1
My guess is that the modified time isn't updated correctly on the remote filesystem. I'm not so sure what would be the fix for this but this at least could be a first trail to follow?
In fact, I just did a little search around and found this bug : https://code.google.com/p/win-sshfs/issues/detail?id=99
With a possible workaround in Sublime 2, I'll let you check if there is such a setting in Sublime 3

Apache Crash Dialog

I'm running XAMPP on my windows machine and experiencing a problem with Apache crashing a couple times a day. When it does, a dialog pops up and I have to manually tell windows to end the program. After I do that, XAMPP automatically starts it back up in a couple of seconds with no issues. When it crashes while I'm not home though, the server is down until I get back. So I have two questions:
Are periodic crashes something that should be expected, or is this indicative of another issue I should be trying to pinpoint?
If this is something I should just learn to deal with, is there a way to automatically restart httpd.exe when these issues occur, so I don't experience down time when I'm away from home?
You'd look into log files, especially the Apache access and error logs, to see what happened, when you are not at home. I've met some similar situation: I have a problematic PHP script hosted on my server, when someone visits the page, it leads to an Apache crash.
I'd suggest you do the investigation as follows:
Search the timestamp of recent Apache restart.
Check the Apache access log to see whether there are some scripts have been accessed.
Manually access these scripts in your browser (to see if Apache will crash again)
You'd better check the PHP error log as well.
If there is really nothing suspicious, you can try WAMP bundle alternatively, which is also a very popular PHP development environment and it is stable.
Although there aren't many cases in which one should "expect" periodic crashes, in this case you are better of reconsidering your setup. From the frontpage of the XAMPP site:
XAMPP is the most popular PHP development environment
Sure, you can use it as "production" server, but XAMPP isn't build for hosting websites, it is intended as development server, so you don't have to manually setup Apache, PHP and MySQL on you dev machine. If you actually want to run your website for the public, setup Apache/IIS, MySQL and PHP manually, those products on there own are made for running in production. Or you can consider getting some cheap shared hosting somewhere, so you don't need to setup anything.

Print PDF from Navision Application Server

I have problem printing reports to PDF through bullzip from Navision Application Server (1) if user is not in Local Admin group (2). Only under both conditions.
In Nav code I'm doing the following: init bullzip automation object (set all parameters to suppress GUI), run report to print document to virtual bullzip printer, catch output file. Thats it. Straight as a rail.
I have two environments: Windows Server 2008 and Windows 7 (different versions of Nav, but this is changing nothing). On Windows 7 it just do nothing (but works if user is admin). On server I can see error in Event Log (translated to English)
Faulting application gui.exe, version 9.8.0.1599, time stamp 0x517126dc, faulting module USER32.dll, version 6.0.6002.18541, time stamp 0x4ec3e39f, exception code 0xc0000142, fault offset 0x0006f52f, the process ID 0x3bc, application start time 0x01ce562238369fa9.
Gui.exe is a part of bullzip.
If I run the same code from Nav Classic Client, or from the same NAS launched in command line, or under local administrator account, or if i put the NAS user in local admin group - it works just fine.
To solve this problem i need to find out one of two and how to fix it:
What is the difference between local admin and regular user that could cause application to crash in non-interactive mode (service) under regular user account.
What is the difference in running NAS as service and as command line that could cause application to crash when run as service.
What I've tried so far: extend non-interactive desktop heap, give user all local privileges that admin have in gpedit. Not works. Don't know direction for further digging.
Any alternative free pdf printers advices are welcome.
This question is still actual. Though I've managed to setup PDF printing with PDFCreator. The tough part was to let several different NAS to print simultaneously. And now the setup have a bottleneck - PDFCreator's printing queue. With bullzip automations it could be avoided.
We've had some cases where third party DLL's have crashed within NAV due to permission restrictions.
The only effective way we could narrow down the files that it was trying to access was through using Process Monitor to try narrow down what was causing permission issues.
We found a folder within System32 to do with the System's Network Profile that some DLLs use. On that note, NAS's and such should be run under a domain account.
I think re-installing the application will do that,
Just make sure you are uninstalling each bullzip and ghost script,
Now Ghost script is tricky thing, if you are installing 32 bit over 64 then you are having problem,
refer this download link download appropriate version, install it,
and then install bullzip, after downloading new version from here
this will do..
then also if any problem(if you are using application for automation, you require new com object..) refer Forum, that explains most of application interface problems..
where you need to use public class PdfSettings with namespace bioPdf.
I hope this will help ..

Ubuntu Lucid, cgi-bin, and MathTex

So I have several dedicated servers out there running Ubuntu Lucid server. They primarily run WordPress sites - LAMP. However, one of my original sites is a controls engineering site that uses MathTex to render the equations.
MathTex is pretty hard on servers. The engineering site is still hosted on the original VPS which runs something like CentOS (but that's irrelevant). The traffic and numbers of renderings that MathTex creates cause resource issues with my VPS. I've been able to allocate more resources to the VPS but ultimately this gets expensive. So I'd like to offload the equation rendering to my dedicated servers all of which are much more powerful and under-utilized.
So I've followed the instructions on installing and compiling MathTex. And MathTex works fine from the command line. However, when I attempt to call the script via my browser the browsers all try download the cgi file (I've tested on Firefox and Chrome on 2 machines).
This led me to attempt to compile and install on my home Ubuntu box that is Ubuntu desktop. The command line works fine. However, again when calling the function in my browser it wanted to download the file instead of rendering an equation. So I moved the mathtex.cgi script to /usr/lib/cgi-bin. Still no go. Then I changed /usr/lib/cgi-bin to 777 and it worked. I changed /usr/lib/cgi-bin to 755 and it stopped working.
So my home box works when /usr/lib/cgi-bin is 777. I tried that one of my dedicated Ubuntu servers and still no go. My browser still attempts to download the file.
The directive for Apache to find the cgi-bin directory is in /etc/apache/site-available/default. And at a quick glance they appear to be identical (I haven't yet studied every character).
FYI
I got some help from my hosting company. They are generally pretty good but this is outside the scope of what they provide for free. So when I was switching servers I had a couple of password issues and managed to tack this question on as well.
The support person finally got the mathtex.cgi script to run by creating a /cgi-bin under the domain's folder. Making that folder 777 and adding an AddHandler cgi-script to the http.conf. Then he restarted Apache2.
I had been putting mathtex.cgi under a generic /cgi-bin directory that I had intended to share among all the domains as needed. And this generic /cgi-bin directory appeared to be what the MathTex installation instructions were suggesting.
Hope this helps someone else.