Custom Output Document

Hi,
We are encountering an issue when creating custom non-PDF documents in our system. After writing the code and uploading it in Cetec, a server error occurs " 500 - Internal Server Error" whenever we try to open the file. I have created three different documents, but the same issue arises each time. The documents are titled:

  1. “Individual Label for Combo”
  2. “Carton Label”
  3. “Individual Label1.”
    https://goldstarmedicalinstruments.cetecerp.com/otd/order/23572/generic_document?document=Individual+Label+for+Combo
    Please investigate why this error occurs when we create and upload non-PDF files in the custom document section.
    Regards,
    Rana Muneeb

Hello Rana,

Any question regarding custom documents within Cetec ERP falls outside of the purview of Cetec Support and is considered billable work.

Would you like for me to connect you with a Cetec ERP engineer to investigate? I am happy to send you an estimated quote.

Sincerely,
Cetec ERP Support

Hi @rana826 ,

Could you elaborate more on where this custom document is supposed to be generated? Is it on the document level of a work order? Based off of the URL structure I think it is.

What I would suggest is taking a copy of any functional doc on the custom doc page that is in the same path that you want this on, and first try to just name it what you want and see if it generates (simply copy paste). If that works, then modify that custom document. It has to be something in your custom document code that is not right. Check if you are missing simple things like [% END %].

I would be happy to take a closer look as perhaps this could benefit my organization as well. My email is tej@ipsassembly.com. Thanks!

Hi @tej @rana826,
I have been playing around a bit with the documents and might also be able to help.
Together I think we can figure it out and perhaps help others.
But as @tej says I also need a bit more elaboration in order to help.

1 Like

Hi @cetecerp19,
I understand that custom document work is considered billable. However, the issue here is that I have created a non-PDF document with simple code, but it seems like the file may not be supported. My concern is whether you can check this document and let me know if the issue is with the system or my code. If it’s my fault, I’ll discuss it further and request a quote. However, if it’s a system issue, I would appreciate it if you could consult with your engineers to resolve it.
Regards,
Rana Muneeb

Hi @tej @sisyfos ,
Sorry for the delayed response; I was out of town, which caused the delay in getting back to you.

Yes, this is at the document level of a work order. I’ve tried using simple code and even copying from other custom documents to get this document to work, but I keep running into issues. I’ve also tried just a basic HTML structure with ‘Hello World,’ but it still failed.

I am confident this is a system issue because it only happens with non-PDF documents. I’ve created multiple PDF documents with no problems, and they run perfectly. However, whenever I create a non-PDF document, I get a ‘500 internal server error.’

When I investigated further, I noticed that non-PDF files don’t have the .tt extension in Cetec’s custom documents, which I believe is part of the problem. I’ve attached a screenshot showing this.

Regards,
Rana Muneeb

Hi @rana826

Yes, I am happy to have engineering review for you. Would you mind sharing the document(s) and I will escalate to them?

  • Cetec ERP Support

I would like to know the answer to this too if it can be shared here!

In my understanding, all custom docs use .tt (Template Toolkit) to render into a PDF. In @rana826’s case, seems like they are trying to generate a non-PDF for what looks like to be labels.

Is it true all custom docs have to be in .tt, because without Template Toolkit variables cannot be called?

Hi @cetecerp19 ,
Thank you for your response and for escalating this to the engineering team. I’ve attached the non-PDF document that’s causing the issue, along with a screenshot highlighting the missing .tt extension.


I also want to mention that when I upload the .tt file in the custom documents section, it initially shows as updated and uploaded successfully. However, after uploading, the .tt extension disappears, and when I try to open the file, I encounter a ‘500 internal server error.’
Please let me know if you need any further details.
Regards,
Rana Muneeb

Hi @tej,
That’s a great point! Yes, I’m trying to generate a non-PDF document, specifically for labels. When I upload the .tt file, it initially shows as updated, but the extension disappears afterward, and I get a ‘500 internal server error’ when I try to open it.

From my experience, it seems like Cetec requires custom documents to have the .tt extension in order to call Template Toolkit variables, which is why I believe this issue is system-related when it comes to non-PDF formats.

I’d love to know if there’s any workaround or if all documents, even non-PDF ones, must rely on .tt for proper functioning.

Regards,
Rana Muneeb

Hi @rana826

I had engineering look at your documents.

Here is engineering’s response: “It appears the customer created their own “non-pdf” custom documents when we don’t believe they needed to. That feature was developed for customers with very specific requirements, where they needed Cetec to generate files of a different file type than what we normally generate, which are PDFs. In general, anything custom doc that they’re printing out of the system should be a PDF. They should just create the PDF versions of those custom documents, upload their template files there, and use those.”

  • Cetec ERP Support

Hi @cetecerp19,
Thank you for the feedback from engineering. After reviewing their response, I have two follow-up questions:

  1. Could you clarify whether the default Cetec documents for part labels, skid labels, and receipt labels are PDF documents or non-PDF documents?
  2. You mentioned that the non-PDF feature was developed for customers with very specific requirements for generating files of different types. Could you provide more details on what file types this feature supports and under what circumstances it would be used?

Additionally, after the recent escalation, we’ve encountered a new issue when uploading documents in the custom documents section. We receive the following error:

**"**Error: Document Upload Failed: write_file ‘/home/Cetec-ERP/documents/goldstarmedicalinstruments/tt//otd/order/Individual Label F/O.tt’ - sysopen: Permission denied at /home/Cetec-ERP/lib/Cetec/Reboot/Schema/Result/CustomDocument.pm line 201.’ "


Could you please assist us in resolving this issue as well?
Regards,
Rana Muneeb

@rana826

I am unable to continue to assist with this issue unless you would like a quote to speak with engineering. Please let me know if you would like to proceed.

  • Cetec ERP Support

Hi @cetecerp19,
Thank you for your response. However, I don’t quite understand one thing — the issue I’m encountering seems to be with the system not allowing the upload of documents into the custom document section. This appears to be a system issue, rather than something related to customizations or billing.
Could you please clarify why this would require paid support? It seems like a technical problem with the system’s file upload functionality that should be addressed as part of standard support.
I appreciate your help and look forward to your response.
Regards,
Rana Muneeb

Hello @rana826

I escalated your documents to engineering as you asked. It was determined by engineering that the issue was not with the system. Engineering determined that the error had to do with your code. I double-checked with engineering this morning, and they wanted me to reiterate that everything custom doc must be in PDF form.

As stated in your previous response, “If it’s my fault, I’ll discuss it further and request a quote.”

I am unable to continue to assist with this issue unless you would like a quote to speak with engineering. Please let me know if you would like to proceed. If not, that is fine and understood, but I will not be able to respond further to this thread. Thank you for your understanding, as I am doing my best to follow my internal protocol and management’s decision on this matter.

  • Cetec ERP Support

Dear @cetecerp19,
Thank you for your previous clarification. However, I believe there might be a misunderstanding regarding the current issue we’re facing.
Since last night, After I requested escalation to engineering, we’ve encountered a new problem: we are now unable to upload .tt files to the custom document section at all, even in cases where it worked previously. Before this, we were able to upload .tt files without issues, and we only faced restrictions with non-PDF documents when creating new entries. Now, however, the error occurs whenever we try to upload .tt files, regardless of the document type.


I kindly ask for your assistance in addressing this matter, and I hope we can resolve it together. I assure you that my intention is not to cause any frustration, and I sincerely appreciate your efforts and patience in helping us.
Thank you for your understanding, and I look forward to your guidance.

Best regards,
Rana Muneeb

Hi @rana826,

I’m going to jump in here to answer the three unanswered questions I’m seeing in this thread, and then I’m going to close it because I think it’s gotten away from the original topic and is no longer useful for this context.

  1. You asked “Could you clarify whether the default Cetec documents … are PDF documents or non-PDF documents?

    All the documents that Cetec generates by default are PDF documents. Anything that you would want to print out of the system, regardless of it’s form factor (printer paper, label, etc.), is created as a PDF, and then either saved to your local machine or printed directly from Chrome. The only exception is list exports, which are typically spreadsheet files.

  2. Could you provide more details on what file types this [non-pdf custom doc] feature supports and under what circumstances it would be used?

    This was originally developed for one of our customers who using a machine on their production floor that takes ordline data from the system that gets put into a file with a specific file format, and performs certain operations on their assemblies based on that data. We are going to work on creating some documentation for our support website to highlight how that works, but based on the examples you’ve provided (various types of labels) it’s not relevant for what you’re trying to do and not useful in the discussion of how to solve the problems you’re having.

  3. …we are now unable to upload .tt files to the custom document section at all, even in cases where it worked previously.

    The name of the document in your screenshot contains a forward slash character. Having that character in the document name is causing the error, because the filepath the system uses to locate your documents also contains forward slashes as part of it’s directory structure, and the additional slash in the document name is causing the system to look for a location on that server that doesn’t exist.

To summarize the things you need to do to resolve your issues:

  • Create new versions of the custom docs you’re trying to use, but use the standard PDF type when creating them instead of “non-pdf”.
  • When creating the corrected PDF version of your “Individual Label F/O” document please avoid using special characters in the filename, especially that forward slash.

If you continue to have issues after those steps please do start a new thread and let us know, we’ll do our best to help.

Thanks!

1 Like