docusealco / docuseal

Open source DocuSign alternative. Create, fill, and sign digital documents ✍️
https://www.docuseal.co
GNU Affero General Public License v3.0
5.7k stars 378 forks source link

Docker Install; 500 when viewing signed docs #156

Closed bigtiger closed 6 months ago

bigtiger commented 7 months ago

Similar situation to a couple other issues. We have Docuseal self hosted.

One person sent it to me and I tested it. It worked. We emailed it to 15 other folks and after a certain point viewing any of the documents created a Docuseal styled 500 error.

It appears the preview images no longer exist. I get the same error even for the first document which had worked. I'm comfortable in a Rails console if it's possible to trigger preview image regeneration.

Here's a stack trace

2023-12-06 15:57:26 I, [2023-12-06T21:57:26.479881 #1]  INFO -- : [76ae1d95-982b-4ef8-b9e2-9b2fe744e861] {"method":"GET","path":"/submissions/19","format":"html","controller":"SubmissionsController","action":"show","status":500,"duration":12.72,"view":0.0,"db":1.97,"fwd":"66.187.37.234"}
2023-12-06 15:57:26 F, [2023-12-06T21:57:26.480779 #1] FATAL -- : [76ae1d95-982b-4ef8-b9e2-9b2fe744e861]   
2023-12-06 15:57:26 [76ae1d95-982b-4ef8-b9e2-9b2fe744e861] ActionView::Template::Error (undefined method `url' for nil:NilClass):
2023-12-06 15:57:26 [76ae1d95-982b-4ef8-b9e2-9b2fe744e861]     26:       <% (@submission.template_schema || @submission.template.schema).each do |item| %>
2023-12-06 15:57:26 [76ae1d95-982b-4ef8-b9e2-9b2fe744e861]     27:         <% document = @submission.template.documents.find { |a| item['attachment_uuid'] == a.uuid } %>
2023-12-06 15:57:26 [76ae1d95-982b-4ef8-b9e2-9b2fe744e861]     28:         <a href="#<%= "page-#{document.uuid}-0" %>" onclick="[event.preventDefault(), window[event.target.closest('a').href.split('#')[1]].scrollIntoView({ behavior: 'smooth', block: 'start' })]" class="block cursor-pointer">
2023-12-06 15:57:26 [76ae1d95-982b-4ef8-b9e2-9b2fe744e861]     29:           <img src="<%= document.preview_images.first.url %>" width="<%= document.preview_images.first.metadata['width'] %>" height="<%= document.preview_images.first.metadata['height'] %>" class="rounded border" loading="lazy">
2023-12-06 15:57:26 [76ae1d95-982b-4ef8-b9e2-9b2fe744e861]     30:           <div class="pb-2 pt-1.5 text-center">
2023-12-06 15:57:26 [76ae1d95-982b-4ef8-b9e2-9b2fe744e861]     31:             <%= item['name'].presence || document.filename.base %>
2023-12-06 15:57:26 [76ae1d95-982b-4ef8-b9e2-9b2fe744e861]     32:           </div>
2023-12-06 15:57:26 [76ae1d95-982b-4ef8-b9e2-9b2fe744e861]   
2023-12-06 15:57:26 [76ae1d95-982b-4ef8-b9e2-9b2fe744e861] app/views/submissions/show.html.erb:29
2023-12-06 15:57:26 [76ae1d95-982b-4ef8-b9e2-9b2fe744e861] app/views/submissions/show.html.erb:26:in `each'
2023-12-06 15:57:26 [76ae1d95-982b-4ef8-b9e2-9b2fe744e861] app/views/submissions/show.html.erb:26
2023-12-06 15:57:26 [76ae1d95-982b-4ef8-b9e2-9b2fe744e861] app/controllers/submissions_controller.rb:12:in `show'
omohokcoj commented 7 months ago

@bigtiger is that possible that the document you're trying to view was signed via a template cloned from the original template which was then removed permanently?

bigtiger commented 7 months ago

The user who created this document started from the + Create button. I only know this because it was the first document they created and we walked through the process together.

I think that means the answer to your question is "No."

omohokcoj commented 7 months ago

@bigtiger can you try to update to the latest version - based on the error log it seems like the code is outdated:

<% document = @submission.template.documents.find

But now we use

<% document = @submission.template_schema_documents.find

to load documents on the page

omohokcoj commented 6 months ago

@bigtiger please reopen if the issue persists in the latest 1.3.5 version