All Products
Search
Document Center

Mobile Platform as a Service:HTML5 application load failure: NoSuchKey. The specified key does not exsit

Last Updated:Oct 30, 2023

Symptom

The developer fails to open the HTML5 application after completing the basic access, and the container page displays the error message “NoSuchKey. The specified key does not exist…”, as shown in the following figure.

1

Error example:

<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<RequestId>5F4DFBE4F1AC943937FBCA6D</RequestId>
<HostId>mcube-prod.oss-cn-hangzhou.aliyuncs.com</HostId>
<Key>A5F87CB301605-beimo/20200024/1.0.0.0_all/nebula/fallback/www/index2.html</Key>
</Error>

Common cause

The direct cause of this type of problem is that the address accessed by the mPaaS Nebula container points to a file, which does not exist on the MDS server. For this reason, the process that triggers the problem is generally as follows. The client tries to access a resource that does not exist in an offline package. The client misses locally, and the online fallback address also misses. So the MDS server returns this error.

Troubleshooting procedure

Based on the cause analysis, the troubleshooting method is described as follows:

  1. Whether the page address of the HTML5 app opened by the client is correct.

  2. Whether the related resources in the offline package are packaged correctly.

Confirm that the address of the page opened by the HTML5 app is correct.

There are three types of situations:

  1. Actively open the HTML5 app and confirm whether the input URL parameter is correct.

    32

  2. According to the logic of the HTML5 app page redirection, confirm whether the opened page address is correct, including the target URL setting of the redirection form such as pushWindow() and location.href.

  3. When uploading the offline package, developers must configure the default entry URL of the HTML5 app. Problem may occur: If the URL is not configured or the configured entry URL is incorrect, the container cannot provide the correct page address when opening the HTML5 app.

Whether the related resources in the offline package are packaged correctly.

  1. Download the .amr file on the console, modify the suffix to .zip and decompress it. Unzip the .tar file in the folder, and then you can see the resource files in the offline package.

    6

    Then confirm whether the page resource file to be opened is contained in this folder.

  2. Confirm whether the environment configuration of current app is consistent with the environment of current offline package.

    Check the App ID in meta.config in the app project:

    7

    Check the App ID on the console where the target HTML5 app offline package is located.