Moved invoice to draft and now get 503 error

Template “Crabe” exhibits the same issue as Sponge. So it’s PDF-related. I switched PDF versions in the Invoice module (1.7, A-3/b, A-1b) and no difference.

But the GET …/facture/card.php?id=… statement in your error log suggests that there is a problem with the handoff from the PDF generation and reloading the (invoice/order/proposal) card page. I can look at the completed PDF when on the (invoice/order/proposal) list.php pages. On the list.php page, click on the download arrow icon after the document number image and select Preview PDF and it will show you the completed PDF that was recently generated.

It looks like there is a conflict when reloading the card page. Is there a way to debug the card.php script line-by-line to find the cause? Is there a change in the tables that is not happening corrrectly? With the persistent 503 error for certain documents (invoices/orders/proposals) after the regen/gen, there has to be some error in the tables.

Yep, can confirm that the PDFs are generated “correctly,” but as you said the card.php call seems to be broken somewhere (maybe the tables) after a PDF is generated. But there are no errors thrown by PHP. My php.log is clean.

Who is your hosting provider, by the by? I’m using Hostgator.

mine is the same, Hostgator. @carguin who do you use?

Yep, hostgator…

@Locodarwin what does your .htaccess file in your public_html directory show? Mine was updated today at 2:49 am and looks like this:

htaccess.txt (1.5 KB)

I also have several .htaccess files on my public_html directory. One (.htaccess.no_htaccess.phpupgrader) is from December 8th and two more(.htaccess.lock-2f9acf49cd790-1d6ec2bf7-c09 and .htaccess.lock-f27779669fa3-1d6ec2bf7-c09) from December 10, 2025.

I started this thread on December 9th.

Do you find similar files? Could Hostgator have caused this? Is someone goofing around in their system? I am not experienced enough to know how these work.

My .htaccess claims to have been updated today at 1:32; I also have an assortment of .htaccess.lock files, but all are from the summer or older. Here is my htaccess:

htaccess.txt (4.9 KB)

I’m wondering if the 60 second max_execution_time is the issue, but then the question would be why on these specific entries only?

I just used the MultiPHP INI editor and put 120 on the first two time options and increased the input_vars option to 5000. I don’t know when this will take effect, but my guess is when they restart the system about 1 to 2 am.

If that works, then we will rejoice together tomorrow.

Mine basically looks like yours - all parameters the same. However, I don’t have any other .htaccess files other than some that were edited back in 2019. I don’t know how old my current one is because it has today’s date on it. I was messing with MultiPHP to use different versions of PHP to see if that made a difference. It doesn’t, btw.

It definitely seems like a Hostgator-specific thing, now, though. Too much of a coincidence that all 3 of us are using Hostgator for Dolibarr and this just started happening this month to all of us.

@lkeet

Yes it is possible to debug line by line - but I haven’t tried it. I always just used dol_syslog statements - I should learn debugging some day, but not right now as I am busy with Real Life stuff :frowning:

It might be that the database tables are not ending up in the correct state. You might be able to determine that if you try with that .ODT template and then another invoice with the .PDF templates - and then compare the database tables.

@lkeet @Locodarwin @carguin Interesting that all of you use hostgator …

Try this:

Topmenu Home

Left menu Admin tools, About PHP

Any red crosses/unsupported/missing/…?

The only thing listed as not supported is the “xDebug” extension. Everything else is green checkmarks

I’m green across the board. Keep in mind - things were working just fine until they stopped working. None of us made any changes ourselves that would account for the error. I for sure did not. I’m not seeing any PHP errors. We’re all using Hostgator, which seems like a very huge clue.

it does indeed @Locodarwin

what if all 3 of you asked Hostgator what is going on?

I have looked at the files in dolibarrdata. For PDFs stored there for invoices/orders/proposals that were generated/regenerated and are now 503 broken, the file permissions are 0660. For all the others that still work, the file permissions are 0755. Where would this be generated from? I tried to change the permission on an affected file to 0755, but it didn’t change the 503 error.

I deleted the PDF for an affected order and the card.php page loaded. It did not show a PDF, so I hit the generate button and it gave me the 503 error. I deleted the file again and reloaded from the list.php page and it loaded correctly.

@lkeet

0660 means -rw-rw---- which means that both the owner and the group of the file has full read and write permissions provided that the process, aka the webserver that runs the PHP process that runs Dolibarr is either the owner or in the group that has Reead+Write access.

I deleted the PDF for an affected order and the card.php page loaded. It did not show a PDF, so I hit the generate button and it gave me the 503 error. I deleted the file again and reloaded from the list.php page and it loaded correctly.

That is good to know.

I would like to know the permissions as well as owner and group of the folder, the parent folder and the grand parent folder, … all the way to /

Please tell me more about your hostgator setup, is it your own virtual private machine, or do you share a machine, or ??

I’d also like to know the value of the umask, so just try to run the umask command ‘umask’

@carguin

Would you mind testing in your container setup.

  1. delete a PDF from order or invoice
  2. reload order/invoice page
  3. generate a new PDF for order/invoice
  4. make the file unreabable inside the container, chmod a-rwx on that file
  5. reload order/invoice page - do you get a 503?
  6. if you don’t get a 503, then try changing the owner and the group of the file to something different - find some username and group names from /etc/passwd and /etc/group - FROM INSIDE THE CONTAINER
  7. reload order/invoice
  8. if you get a 503, try restoring the file permissions inside the container with chmod a+rw on that file

MAIN_UMASK in About Dolibarr under Admin menu-Parameters database is 0660.

All folders to my root / are 0755. Only the PDF file is 0660.

I am on a shared machine.