doc-exports/docs/swr/umn/swr_faq_0016.html
Dong, Qiu Jian 38e4c01e6c SWR UMN: Permission description is added
Reviewed-by: Eotvos, Oliver <oliver.eotvos@t-systems.com>
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com>
Co-authored-by: Dong, Qiu Jian <qiujiandong1@huawei.com>
Co-committed-by: Dong, Qiu Jian <qiujiandong1@huawei.com>
2024-06-18 06:49:13 +00:00

40 lines
7.6 KiB
HTML

<a name="swr_faq_0016"></a><a name="swr_faq_0016"></a>
<h1 class="topictitle1">Why Does the Login Command Fail to Be Executed?</h1>
<div id="body1557040947771"><p id="swr_faq_0016__p978932114263">Possible causes are as follows:</p>
<ol id="swr_faq_0016__ol6548194315293"><li id="swr_faq_0016__li6707845345">The container engine is not properly installed, in which case the following error is reported:<p id="swr_faq_0016__p1028410497819"><a name="swr_faq_0016__li6707845345"></a><a name="li6707845345"></a><span class="parmname" id="swr_faq_0016__parmname1293395612162"><b>docker: command not found</b></span></p>
<p id="swr_faq_0016__p9798943134912"><strong id="swr_faq_0016__b22892254421">Solution</strong>: Reinstall the container engine.</p>
<ul id="swr_faq_0016__ul57981243154916"><li id="swr_faq_0016__li15798643114913">It is advised to install container engine 1.11.2 or later because earlier versions do not support image push to SWR.</li><li id="swr_faq_0016__li67981743134919">If the container engine client is in a private network, bind an elastic IP address (EIP) to the client. This EIP will allow the client to download installation packages from the website.</li></ul>
</li></ol><ol start="2" id="swr_faq_0016__ol1827018155358"><li id="swr_faq_0016__li1489599133814"><a name="swr_faq_0016__li1489599133814"></a><a name="li1489599133814"></a>The temporary login command has expired, or the regional project name, access key (AK), or login key in the command is incorrect, in which case the following error is reported:<p id="swr_faq_0016__p102131319111715"><a name="swr_faq_0016__li1489599133814"></a><a name="li1489599133814"></a><span class="parmname" id="swr_faq_0016__parmname6132185631716"><b>unauthorized: authentication required</b></span></p>
<p id="swr_faq_0016__p134451740112219"><strong id="swr_faq_0016__b19190123161314">Solution</strong>: Log in to the SWR console. In the navigation pane on the left, choose <span class="uicontrol" id="swr_faq_0016__uicontrol12417723143"><b>My Images</b></span>. On the page displayed, click <span class="uicontrol" id="swr_faq_0016__uicontrol1568191420155"><b>Upload Through Client</b></span>. Then you can find the information on how to obtain a login command.</p>
<ol type="a" id="swr_faq_0016__ol221311119194"><li id="swr_faq_0016__li48456813192"><a name="swr_faq_0016__li48456813192"></a><a name="li48456813192"></a>To obtain a <span id="swr_faq_0016__text1784712813194">temporary</span> login command, click <span class="uicontrol" id="swr_faq_0016__uicontrol2847148121913"><b>Generate a <span id="swr_faq_0016__text1484718851913">temporary</span> login command</b></span> and then click <span><img id="swr_faq_0016__image1084710819196" src="en-us_image_0168961239.png"></span> to copy the command.</li><li id="swr_faq_0016__li1121317115192">To obtain a long-term valid login command, click <span class="uicontrol" id="swr_faq_0016__uicontrol278819232159"><b>learn how to obtain a login command that has long-term validity</b></span> and follow the instructions.</li></ol>
</li><li id="swr_faq_0016__li8810124123620">The image repository address in the login command is incorrect, in which case the following error is reported:<p id="swr_faq_0016__p3887111061811"><a name="swr_faq_0016__li8810124123620"></a><a name="li8810124123620"></a><span class="parmname" id="swr_faq_0016__parmname74741137172014"><b>Error llgging in to v2 endpoint, trying next endpoint: Get https://{{endpoint}}/v2/: dial tcp: lookup {{endpoint}} on xxx.xxx.xxx.xxx:53 : no such host</b></span></p>
<p id="swr_faq_0016__p11837192511914"><strong id="swr_faq_0016__b10860142153717">Solutions</strong>:</p>
<ol type="a" id="swr_faq_0016__ol17536172718198"><li id="swr_faq_0016__li634415126242">Change the image repository address in the login command.</li><li id="swr_faq_0016__li1799316130211">Generate a temporary login command. For detailed instructions, see <a href="#swr_faq_0016__li48456813192">2</a>.</li></ol>
</li><li id="swr_faq_0016__li1116344465619"><strong id="swr_faq_0016__b92561268110">x509: certificate has expired or is not yet valid</strong><p id="swr_faq_0016__p1148761120418">The preceding error is reported when the AK/SK in the login command with long-term validity is deleted. In this case, use a valid AK/SK to generate a login command.</p>
</li><li id="swr_faq_0016__li536512401265"><strong id="swr_faq_0016__b25641546102617">x509: certificate signed by unknown authority</strong><p id="swr_faq_0016__p11370201123212"><strong id="swr_faq_0016__b564022718325">Possible Causes</strong>:</p>
<p id="swr_faq_0016__p4437135662719">The container engine client communicates with SWR through HTTPS. The client verifies the server certificate. If the server certificate is not issued by an authoritative organization, the following error message is displayed: "x509: certificate signed by unknown authority"</p>
<p id="swr_faq_0016__p7728141713212"><strong id="swr_faq_0016__b1479592488">Solutions</strong>:</p>
<p id="swr_faq_0016__p4665192433211">If you trust the server and skip certificate authentication, manually configure Docker startup parameters as follows:</p>
<ul id="swr_faq_0016__ul1566119153512"><li id="swr_faq_0016__li566101917353">CentOS:<p id="swr_faq_0016__p1552414310352"><a name="swr_faq_0016__li566101917353"></a><a name="li566101917353"></a>Modify the <span class="filepath" id="swr_faq_0016__filepath368710155463"><b>/etc/docker/daemon.json</b></span> file. If the file does not exist, manually create it. Add the following content to the file:</p>
<pre class="screen" id="swr_faq_0016__screen81658473718">{
"insecure-registries": ["<em id="swr_faq_0016__i16762152034613">{Image repository address}</em>"]
}</pre>
</li><li id="swr_faq_0016__li14440112514358">Ubuntu:<p id="swr_faq_0016__p1512819335356"><a name="swr_faq_0016__li14440112514358"></a><a name="li14440112514358"></a>Modify the <strong id="swr_faq_0016__b94631854204617">/etc/default/docker</strong> file and add the following content to <strong id="swr_faq_0016__b1238117411476">DOCKER_OPTS</strong>:</p>
<pre class="screen" id="swr_faq_0016__screen10673103485714">DOCKER_OPTS="--insecure-registry {image repository address}"</pre>
</li><li id="swr_faq_0016__li157081347311">EulerOS:<p id="swr_faq_0016__p161294111437"><a name="swr_faq_0016__li157081347311"></a><a name="li157081347311"></a>Modify the <strong id="swr_faq_0016__b12562638134720">/etc/sysconfig/docker</strong> file and add the following content to <strong id="swr_faq_0016__b55681238134710">INSECURE_REGISTRY</strong>:</p>
<pre class="screen" id="swr_faq_0016__screen414044014109">INSECURE_REGISTRY='--insecure-registry {image repository address}'</pre>
</li></ul>
<div class="note" id="swr_faq_0016__note1335517565599"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="swr_faq_0016__p815075903">The image repository address can be a domain name or an IP address.</p>
<ul id="swr_faq_0016__ul13701172913547"><li id="swr_faq_0016__li111171558161912">To obtain the image repository address in domain name format, obtain a temporary login command by referring to <a href="#swr_faq_0016__li1489599133814">2</a>. The domain name at the end of the command is the image repository address.</li><li id="swr_faq_0016__li13815034185410">To obtain the image repository address in IP address format, ping the image repository address in the domain name format.</li></ul>
</div></div>
<p id="swr_faq_0016__p15166174093715">After the configuration, run the <strong id="swr_faq_0016__b1820438171415">systemctl restart docker</strong> command to restart the container engine.</p>
</li></ol>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="swr_faq_2000.html">Troubleshooting</a></div>
</div>
</div>