Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

PDF Stamper – Getting 502 Gateway Error

by

Tips and Tricks HQ Support Portal › Forums › WP PDF Stamper › WP PDF Stamper Troubleshooting › PDF Stamper – Getting 502 Gateway Error

Tagged: pdf stamper, WPEngine

  • This topic has 13 replies, 4 voices, and was last updated 11 years, 4 months ago by wzp.
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • December 16, 2013 at 9:21 pm #10247
    kramdraw85
    Member

    I get intermittent errors when trying to use the API to stamp a pdf. It will work about 30% of the time.

    I have tried both stamping methods. My host is WP Engine

    December 16, 2013 at 10:12 pm #59697
    mbrsolution
    Spectator

    Hello try the following plugin for the minimum requirements

    Minimum Requirements for the WP PDF Stamper Plugin

    Because you are using WP Engine, can you ask them if this plugin is accepted by them? I know they are very strict when it comes to plugins running in their servers.

    Kind regards

    December 17, 2013 at 4:41 am #59698
    kramdraw85
    Member

    Already did that, minimum requirements are met.

    December 17, 2013 at 8:10 am #59699
    kramdraw85
    Member

    What exactly would be causing this issue? It would be nice to have some things to bounce off of WP Engine so we can trouble shoot this further.

    December 17, 2013 at 10:19 pm #59700
    admin
    Keymaster

    Ask WP Engine the following question:

    When I go to use a system to stamp PDF file, it gives a 502 Bad Gateway error intermittently. This happens intermittently so the server is not liking something when it fails but how can I get more info on what the server is not liking? If there was an issue in the script then it would fail every time but it only fails intermittently.

    December 18, 2013 at 3:41 am #59701
    wzp
    Moderator

    Think the Twitter “Fail Whale.”

    ‘http://pcsupport.about.com/od/findbyerrormessage/a/502error.htm’

    December 29, 2013 at 10:50 pm #59702
    kramdraw85
    Member

    The response from the webhost was:

    “If they say that there is something on our end that can be tweaked, I’ll be more than happy to look into accommodating their suggestion. Unfortunately without the additional information from the developer, we wouldn’t really be able to know where to begin looking for what’s causing the error.”

    Is there any thing that I can ask them to look for?

    December 30, 2013 at 2:15 am #59703
    admin
    Keymaster

    I understand that but the issue is that the server doesn’t tell us what its not liking at all. There is not error message or anything. It just says 502 error which is a very generic error code that doesn’t really mean anything. Is the server’s memory getting overloaded at that stage? Is the CPU getting overloaded?

    Will it help, if you can give them the URL that they can click on again and again until they see that error. Then when they do they can investigate various server parameters to get more info (instead of just a generic 502 code).

    December 31, 2013 at 11:01 pm #59704
    kramdraw85
    Member

    From WebHost:

    I’ve been looking around trying to find the cause of the error and I found a couple entries in the nginx error log:

    2013/12/31 00:34:55 [error] 31917#0: *335952 upstream prematurely closed connection while reading response header from upstream, client: 198.58.119.83, server: www.foxlsat.com, request: "POST /wp-content/plugins/wp-pdf-stamper/api/stamp_api.php HTTP/1.1", upstream: "http://127.0.0.1:6789/wp-content/plugins/wp-pdf-stamper/api/stamp_api.php", host: "www.foxlsat.com"

    2013/12/31 00:39:37 [error] 31917#0: *337717 upstream prematurely closed connection while reading response header from upstream, client: 198.58.119.83, server: www.foxlsat.com, request: "POST /wp-content/plugins/wp-pdf-stamper/api/stamp_api.php HTTP/1.1", upstream: "http://127.0.0.1:6789/wp-content/plugins/wp-pdf-stamper/api/stamp_api.php", host: "www.foxlsat.com"

    2013/12/31 00:46:45 [error] 31917#0: *340628 upstream prematurely closed connection while reading response header from upstream, client: 198.58.119.83, server: www.foxlsat.com, request: "POST /wp-content/plugins/wp-pdf-stamper/api/stamp_api.php HTTP/1.1", upstream: "http://127.0.0.1:6789/wp-content/plugins/wp-pdf-stamper/api/stamp_api.php", host: "www.foxlsat.com"

    2013/12/31 01:20:36 [error] 31912#0: *352355 upstream prematurely closed connection while reading response header from upstream, client: 198.58.119.83, server: www.foxlsat.com, request: "POST /wp-content/plugins/wp-pdf-stamper/api/stamp_api.php HTTP/1.1", upstream: "http://127.0.0.1:6789/wp-content/plugins/wp-pdf-stamper/api/stamp_api.php", host: "www.foxlsat.com"

    When trying to download a PDF, it looks like the file stamped.pdf is requested, which then makes a request to stamp_api.php. It’s at this point it looks like the connection is being closed, which will result in a 502 error. It looks like stamp_api.php is an encrypted file so I’m unfortunately unable to see what exactly that file is doing.

    I tried to download a file and monitored the server resources while doing so and I didn’t see it running out of memory or using too much CPU.

    December 31, 2013 at 11:56 pm #59705
    kramdraw85
    Member

    fyi…the stamped.pdf is actually stamped.php and it is where I put the API code.

    stamped.php contents:

    [removed code after checking it]

    January 1, 2014 at 11:18 pm #59706
    admin
    Keymaster

    The plugin doesn’t close any connection (otherwise it would do it on every single site). Obviously something on this site is causing it to close the connection but I have no idea what that is. Are you trying to stamp files from s2Member plugin?

    January 4, 2014 at 12:59 am #59707
    kramdraw85
    Member

    It is pulling in the files from a s2Member plugin folder, but I setup a copy of the site on another server and it is working fine. Could it be a permissions issue?

    January 4, 2014 at 1:08 am #59708
    kramdraw85
    Member

    I also noticed that the created files are being hosted on a cdn. Perhaps that is where the miscommunication is happening?

    January 4, 2014 at 1:11 am #59709
    wzp
    Moderator

    All source and destination files must be on the same server that is running PDF Stamper.

  • Author
    Posts
Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ