<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://test-devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>FOTA in nRF91 SLM gets 404 due to double `/` in file path</title><link>https://test-devzone.nordicsemi.com/f/nordic-q-a/86861/fota-in-nrf91-slm-gets-404-due-to-double-in-file-path</link><description>I am unable to do a FOTA with the SLM application on a nRF9160. When I try to do a FOTA with the command below, I get a 404 even though I know the URL exists (real host name redacted). For reference, this is on NCS v1.9.1. 
 
 After digging a bit more</description><dc:language>en-US</dc:language><generator>Telligent Community 13 Non-Production</generator><lastBuildDate>Tue, 10 May 2022 13:19:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://test-devzone.nordicsemi.com/f/nordic-q-a/86861/fota-in-nrf91-slm-gets-404-due-to-double-in-file-path" /><item><title>RE: FOTA in nRF91 SLM gets 404 due to double `/` in file path</title><link>https://test-devzone.nordicsemi.com/thread/367196?ContentTypeID=1</link><pubDate>Tue, 10 May 2022 13:19:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c1bcc02-1866-42a2-a985-3d6a430eb7cd</guid><dc:creator>user115230</dc:creator><description>&lt;p&gt;Hi Charlie,&lt;/p&gt;
&lt;p&gt;Thanks for the follow up. This all makes sense now. I was server the firmware out of an AWS S3 bucket so it makes sense I was seeing the problem. I&amp;#39;m not a web guy by nature, so I wouldn&amp;#39;t have known some servers are picky about the leading slash. Thanks for digging deep on this with me and getting that fix in!&lt;/p&gt;
&lt;p&gt;~Matt&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FOTA in nRF91 SLM gets 404 due to double `/` in file path</title><link>https://test-devzone.nordicsemi.com/thread/367139?ContentTypeID=1</link><pubDate>Tue, 10 May 2022 10:32:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:727b972e-ebfd-48b8-a8a6-de6637dd5076</guid><dc:creator>user93921</dc:creator><description>&lt;p&gt;Hi Matt,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I had one deep discussion with our developer. Based on &lt;a href="https://en.wikipedia.org/wiki/Uniform_Resource_Identifier"&gt;the spec of URI scheme&lt;/a&gt;, file &amp;lt;path&amp;gt; should include the leading&amp;quot;/&amp;quot;. This is the reason why we keep it and there is no problem when we test with&amp;nbsp;&lt;span&gt;our R&amp;amp;D HTTP test server.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;After your bug reporting, we did a test on AWS and another HTTP test server, then we see the same problem as you reported. It seems some servers&lt;span&gt;&amp;nbsp;do not like &amp;#39;/&amp;#39; in the beginning.&amp;nbsp;&lt;/span&gt;We decided to update&lt;span&gt;&amp;nbsp;the PR with permanent removal of the leading &amp;#39;/&amp;#39;, as it is also tested OK with R&amp;amp;D test server.&amp;nbsp;&lt;/span&gt;You can find the fixing PR from&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-nrf/pull/7538/files"&gt;application: serial_lte_modem: Handle FOTA image under WWW root by junqingzou · Pull Request #7538 · nrfconnect/sdk-nrf (github.com)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks again for helping us improve our product! We really appreciate your contribution!&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FOTA in nRF91 SLM gets 404 due to double `/` in file path</title><link>https://test-devzone.nordicsemi.com/thread/366262?ContentTypeID=1</link><pubDate>Wed, 04 May 2022 13:32:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a934da7f-1a8b-4868-8a3e-d68835fe31a1</guid><dc:creator>user93921</dc:creator><description>&lt;p&gt;Hi Matt,&lt;/p&gt;
&lt;p&gt;Not sure by far, in fact, I set up an HTTP server yesterday in order to do the test by myself. I can confirm the problem exists and your solution works on my side now, but I still need to have further discussion with the developers&amp;nbsp;&lt;span&gt;in Japan which has&amp;nbsp;Golden Week vacation time now. They will be back next week. I have raised an internal case to follow up on this issue and will give you an update on your concern.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This ticket will keep open until we figure out the cause. Thank you again for your patience.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Charlie&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FOTA in nRF91 SLM gets 404 due to double `/` in file path</title><link>https://test-devzone.nordicsemi.com/thread/366243?ContentTypeID=1</link><pubDate>Wed, 04 May 2022 12:54:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d7d1580-e3bc-4bde-8de9-603696bf1e89</guid><dc:creator>user115230</dc:creator><description>&lt;p&gt;Thank you Charlie, that&amp;#39;s great news. I have a follow on question, does this mean that FOTA update was completely broken in v1.9.1 for the SLM? If so, I&amp;#39;m curious on the details of how that bug slipped in to a production release. We intend to use the SLM in production, and breakage of a critical feature like FOTA update in an SDK release needs some understanding from our side.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FOTA in nRF91 SLM gets 404 due to double `/` in file path</title><link>https://test-devzone.nordicsemi.com/thread/366238?ContentTypeID=1</link><pubDate>Wed, 04 May 2022 12:39:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e99c04f1-5d28-42d1-9e41-aa451d7523df</guid><dc:creator>user93921</dc:creator><description>&lt;p&gt;Hi Matt,&lt;/p&gt;
&lt;p&gt;Sorry for the late reply, lost your case by mistake.&lt;/p&gt;
&lt;p&gt;I can confirm your fix is correct and&amp;nbsp;this will be fixed on the next NCS&amp;nbsp; release. Thanks for your contribution.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FOTA in nRF91 SLM gets 404 due to double `/` in file path</title><link>https://test-devzone.nordicsemi.com/thread/365041?ContentTypeID=1</link><pubDate>Tue, 26 Apr 2022 20:24:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37db3e91-702f-4760-8e83-61f6420e766b</guid><dc:creator>user115230</dc:creator><description>&lt;p&gt;Hi Charlie, is there any update from the developers? I&amp;#39;m eager to know if this is a bug in the SLM or an error on my side.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FOTA in nRF91 SLM gets 404 due to double `/` in file path</title><link>https://test-devzone.nordicsemi.com/thread/363202?ContentTypeID=1</link><pubDate>Wed, 13 Apr 2022 13:11:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c7ca258-ba30-4863-8adb-3fa28529746a</guid><dc:creator>user93921</dc:creator><description>&lt;p&gt;Hi Matt,&lt;/p&gt;
&lt;p&gt;Thanks for reporting and sharing your solution. I will forward it to our developer for further investigation.&lt;/p&gt;
&lt;p&gt;Have a good easter holiday!&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Charlie&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FOTA in nRF91 SLM gets 404 due to double `/` in file path</title><link>https://test-devzone.nordicsemi.com/thread/363022?ContentTypeID=1</link><pubDate>Tue, 12 Apr 2022 12:50:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39934470-fa7b-4771-a324-185369f8bf4f</guid><dc:creator>user115230</dc:creator><description>&lt;p&gt;A little follow up info, I have a work around solution for now in my code that works for now. This might help shed some light on whats going on.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;// File: slm_at_fota.c
// function: do_fota_start

	if (parser.field_set &amp;amp; (1 &amp;lt;&amp;lt; UF_PATH)) {
		/* This is a hack to remove the leading &amp;#39;/&amp;#39; in the file path. The Noridc
		 * download_client library adds another implicit leading `/` which will
		 * result in a 404 due to a double `//` on the path. This looks to be a
		 * bug in Noridc code, but we&amp;#39;re not sure at this point.
		 * See: https://devzone.nordicsemi.com/f/nordic-q-a/86861/fota-in-nrf91-slm-gets-404-due-to-double-in-file-path
		 */
		if (parser.field_data[UF_PATH].len &amp;gt;= 1 &amp;amp;&amp;amp;
		    file_uri[parser.field_data[UF_PATH].off] == &amp;#39;/&amp;#39;) {
			parser.field_data[UF_PATH].off++;
			parser.field_data[UF_PATH].len--;
		}

		strncpy(path, file_uri + parser.field_data[UF_PATH].off,
			parser.field_data[UF_PATH].len);
	} else {
		LOG_ERR(&amp;quot;Parse path error&amp;quot;);
		return -EINVAL;
	}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>