<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="184593" data-post-id="184593">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tanweerdev" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tanweerdev/120/8781_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tanweerdev
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Eiji" data-post="10" data-topic="33405">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/eiji/48/36743_2.png" class="avatar"> Eiji:</div>
<blockquote>
<p>I saw similar problems in other libraries (other languages) and there with exactly same error people found that the configuration was incorrect, but it does not looks like your use case</p>
</blockquote>
</aside>
<p>configurations for which part? (Note: I think I have shared plenty of configs above)</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="184593" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/for-no-obvious-reasons-my-request-hangs-when-i-try-to-upload-hundreds-of-images-files-to-aws/33405/12">Post #11</a>
	                </div>
	            </div>
              <div id="likers-container-184593" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="184593"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #11"></div>
  </section>
</div>
    <div class="postbit" id="184594" data-post-id="184594">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Eiji" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Eiji/120/36743_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Eiji
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="tanweerdev" data-post="12" data-topic="33405">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tanweerdev/48/8781_2.png" class="avatar"> tanweerdev:</div>
<blockquote>
<p>configurations for which part? (Note: I think I have shared plenty of configs above)</p>
</blockquote>
</aside>
<p>Nvm, I just looked at similar issues and people in other libraries were declaring for example <code>port</code> where it was not needed to.</p>
<p>Just for example:<br>
<a href="https://github.com/minio/minio-js/issues/701#issuecomment-418078532" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/minio/minio-js/issues/701#issuecomment-418078532</a></p>
<p>This shows that’s really hard to guess what’s the problem. There may be many reasons for that.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="184594" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/for-no-obvious-reasons-my-request-hangs-when-i-try-to-upload-hundreds-of-images-files-to-aws/33405/13">Post #12</a>
	                </div>
	            </div>
              <div id="likers-container-184594" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="184594"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #12"></div>
  </section>
</div>
    <div class="postbit" id="184595" data-post-id="184595">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Eiji" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Eiji/120/36743_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Eiji
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Hmm … on the other side in this issue:<br>
<a href="https://github.com/request/request/issues/2047" class="onebox" target="_blank" rel="noopener nofollow ugc">https://github.com/request/request/issues/2047</a><br>
people are talking about changing request headers …</p>
<p>I don’t have an <code>AWS</code>-based project right now. Do you think you can try those suggestions? Maybe <code>AWS</code> does not supports some headers like those mentioned in issue …</p>
<p>Maybe easier would be to compare working request (like <code>curl</code>) with current one?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="184595" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/for-no-obvious-reasons-my-request-hangs-when-i-try-to-upload-hundreds-of-images-files-to-aws/33405/14">Post #13</a>
	                </div>
	            </div>
              <div id="likers-container-184595" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="184595"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #13"></div>
  </section>
</div>
    <div class="postbit" id="184620" data-post-id="184620">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tanweerdev" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tanweerdev/120/8781_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tanweerdev
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="Eiji" data-post="14" data-topic="33405">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/eiji/48/36743_2.png" class="avatar"> Eiji:</div>
<blockquote>
<p>people are talking about changing request headers</p>
</blockquote>
</aside>
<p>Thanks for the help. But looks connection is being closed before even response was sent back to client. I tried few combinations from below configs</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">config :cybord, CybordWeb.Endpoint,
  url: [host: "localhost"],
  http: [
    port: 4000,
    protocol_options: [
      # request_timeout: 60000,
      inactivity_timeout: 60000, # 60000 millisecods equals one min
      max_request_line_length: 99_999_999_999,
      idle_timeout: :infinity
    ]
  ],
</code></pre>
<p>if I have <strong>inactivity_timeout: :infinity</strong>, it will process all the files but will not send back response even after processing it. I found this article helpful but even this doesnt provide details about the protocol possible options. As soon as All tasks are processed via async_stream (I have also tried to use chunk of 4 and then do task await or Task.async_stream) I need to insert some record in db and send back response. So in my opinion solution lies in http protocol options but as documentation is not very clear. I cant figure out how to achieve this. Thanks in advance for all the effort and help <a class="mention" href="/u/eiji" rel="nofollow">@Eiji</a></p>
<p>Related article: <a href="https://www.poeticoding.com/dealing-with-long-running-http-requests-and-timeouts-in-phoenix/" class="inline-onebox" rel="noopener nofollow ugc">Dealing with long-running HTTP Requests and Timeouts in Phoenix</a><br>
and options: <a href="https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_http/" rel="noopener nofollow ugc">https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_http/</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="184620" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/for-no-obvious-reasons-my-request-hangs-when-i-try-to-upload-hundreds-of-images-files-to-aws/33405/15">Post #14</a>
	                </div>
	            </div>
              <div id="likers-container-184620" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="184620"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #14"></div>
  </section>
</div>
    <div class="postbit" id="184645" data-post-id="184645">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="Eiji" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/Eiji/120/36743_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  Eiji
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="tanweerdev" data-post="15" data-topic="33405">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/tanweerdev/48/8781_2.png" class="avatar"> tanweerdev:</div>
<blockquote>
<p>I have also tried to use chunk of 4 and then do task await or Task.async_stream</p>
</blockquote>
</aside>
<p>ok, so most probably it’s not about content size except there is some limit on <code>S3</code>, but I don’t think it’s that as I believe that it should return a proper error response …</p>
<p>I have one more idea … Can you please compare result of:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">S3.put_object(component_bucket(), destination_path, file)
</code></pre>
<p>with this documentation:</p><aside class="onebox allowlistedgeneric" data-onebox-src="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html">
  <header class="source">
      <img src="https://docs.aws.amazon.com/assets/images/favicon.ico" class="site-icon" alt="" width="48" height="48">

      <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html" target="_blank" rel="noopener nofollow ugc">docs.aws.amazon.com</a>
  </header>

  <article class="onebox-body">
    

<h3><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html" target="_blank" rel="noopener nofollow ugc">PutObject - Amazon S3</a></h3>

  <p>Adds an object to a bucket.</p>


  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>

<p>If it’s not that then I don’t think it’s possible to debug it properly at least from your app … Maybe we would need to debug some values in <code>ex_aws</code> code to have more information about request …</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="184645" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/for-no-obvious-reasons-my-request-hangs-when-i-try-to-upload-hundreds-of-images-files-to-aws/33405/16">Post #15</a>
	                </div>
	            </div>
              <div id="likers-container-184645" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="184645"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-last-post cat-last-post" title="Last post!"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <span class="all-loaded">— All posts loaded —</span>
</div></template></turbo-stream>