Halaman ini belum tersedia dalam bahasa lokal Anda. Kami berusaha keras untuk menambahkan lebih banyak versi bahasa. Terima kasih atas dukungan Anda.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Notable Issues

Updated on 2024-12-03 GMT+08:00
NOTICE:

If you have any questions during development, post them on the Issues page of GitHub. For details about parameters and usage of each API, see the API Reference.

SignatureDoesNotMatch

Status-->403
Code-->SignatureDoesNotMatch

This error occurs if the SK input into ObsClient initialization is incorrect. Solution: Make sure that the SK is correct.

MethodNotAllowed

Status-->405
Code-->MethodNotAllowed

This error occurs because a feature on which the ObsClient API depends has not been rolled out on the requested OBS server. Contact the OBS O&M team for further confirmation.

Network Error

Error: Network Error

Possible causes are as follows:

  1. The endpoint input into ObsClient initialization is incorrect. Solution: Verify to make sure that the endpoint is correct.
  2. The network between the OBS client and OBS server is abnormal. Solution: Check the health status of the network.
  3. The OBS domain name resolved by DNS is inaccessible. Solution: Contact the OBS O&M team.
  4. The SDK depends on the compatibility of the underlying library Axios. Solution: Perform a browser-based upload or contact the OBS O&M team.

Request Timeout

timeout of xxx exceeded

Possible causes are as follows:

  1. The network latency between the OBS client and OBS server is too long. Solution: Check the health status of the network.
  2. The network connection between the OBS client and OBS server is abnormal. Solution: Check the network status.

Cross-Origin Requests are Blocked

Access to XMLHttpRequest at 'xxx' from origin 'xxx' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

This error occurs because the bucket does not have the CORS rule or the CORS rule is invalid. Solution: Reconfigure the bucket CORS by referring to Configuring the Bucket CORS.

The Request Is Successful, but Some Fields Are Missing in the Response

Possible causes are as follows:

  1. The Expose Header configuration in the CORS rule of a bucket is incomplete. For example, ETag is not configured, which makes the ETag value unable to be obtained after an object is successfully uploaded; or x-obs-request-id is not configured, which makes the request ID returned by the OBS server unable to be obtained after a request is complete. Solution: Reconfigure the CORS rule for the bucket by referring to Configuring CORS for a Bucket.
  2. SDK of an earlier version is used. Solution: Upgrade the SDK to the latest version. Download the latest version.

A Loading Error Occurs After the SDK Is Integrated into the Internet Explorer

SCRIPT5009: 'Promise' is not defined.

The cause is that the Internet Explorer does not support the Promise object (ES6). The solutions are as follows:

  1. Use esdk-obs-browserjs-x.x.x.min.js as the SDK library file instead of esdk-obs-browserjs-without-polyfill-x.x.x.min.js in the program.
  2. Introduce a third-party library to the Internet Explorer to supplement ES6. For example, introduce the babel-polyfill library.
  3. Use browsers that support ES6, such as Chrome or Firefox.

Failed to Obtain the ETag Value after Upload

After a file is successfully uploaded by calling ObsClient.putObject or ObsClient.uploadPart, the returned result does not contain the ETag value. The possible causes are as follows:

  1. The ETag header was not included in ExposeHeader in the CORS configuration of the bucket. Solution: Configure CORS for the bucket by referring to Configuring CORS for a Bucket.
  2. The ETag header was included in ExposeHeader in the CORS configuration of the bucket but was just shielded in the result returned by the browser. This problem usually occurs to the browser of an earlier version. Solution: Upgrade the browser to a new version that supports HTML5.

ObsClient Is Not Defined

Uncaught ReferenceError: ObsClient is not defined

Possible causes are as follows:

  1. The SDK is not correctly introduced to the program. Solution: Check whether the esdk-obs-browserjs-x.x.x.min.js or esdk-obs-browserjs-without-polyfill-x.x.x.min.js file is correctly introduced by checking the method of introducing the SDK.
  2. The AMD modular components, such as require.js, are introduced to the program. Solution: Create an instance of ObsClient according to AMD.
  3. A component introduced in the program conflicts with the SDK dependent library (this scenario seldom occurs). Solution: Contact the OBS O&M team.

Unable to Upload Files Using a Browser that Does Not Support window.File

Error: source file must be an instance of window.File or window.Blob

The SDK depends on window.File provided by HTML5 to upload files. For browsers that do not support window.File, such as IE8 and IE9, files cannot be uploaded by calling ObsClient.putObject or ObsClient.uploadFile. Solution: Perform a browser-based upload. The procedure is as follows:

  1. Check whether the browser supports window.File. The code example is as follows:

    function getBrowserInfo() {
           var agent = navigator.userAgent.toLowerCase();
           var regStr_ie = /msie [\d.]+;/gi;
           var regStr_ff = /firefox\/[\d.]+/gi
           var regStr_chrome = /chrome\/[\d.]+/gi;
           var regStr_saf = /safari\/[\d.]+/gi;
           var isIE = agent.indexOf('compatible') > -1 && agent.indexOf('msie' > -1); 
           var isEdge = agent.indexOf('edge') > -1 && !isIE; 
           var isIE11 = agent.indexOf('trident') > -1 && agent.indexOf('rv:11.0') > -1;
           if (isIE) {
                  var reIE = new RegExp('msie (\\d+\\.\\d+);');
                  reIE.test(agent);
                  var fIEVersion = parseFloat(RegExp['$1']);
                  if (fIEVersion == 7) {
                         return 'IE/7';
                  } else if (fIEVersion == 8) {
                         return 'IE/8';
                  } else if (fIEVersion == 9) {
                         return 'IE/9';
                  } else if (fIEVersion == 10) {
                         return 'IE/10';
                  } 
           } 
           // isIE end 
           if (isIE11) {
                  return 'IE/11';
           }
           // Firefox
           if (agent.indexOf('firefox') > 0) {
                  return agent.match(regStr_ff);
           }
           // Safari
           if (agent.indexOf('safari') > 0 && agent.indexOf('chrome') < 0) {
                  return agent.match(regStr_saf);
           }
           // Chrome
           if (agent.indexOf('chrome') > 0) {
                  return agent.match(regStr_chrome);
           }
           return '';
    }
    
    var browserInfo = getBrowserInfo();
    // Check whether the browser supports window.File.
    var isSupportFileApi = browserInfo !== 'IE/7' && browserInfo !== 'IE/8' && browserInfo !== 'IE/9' && window.File;

  2. Select a proper upload method based on the result in step 1. The code example is as follows:

    function postObject(){
       // Use JS code to submit a form for the browser-based upload.
    }
    if(isSupportFileApi){
           // Upload files in browser-based mode.
           return postObject();
    }
    // Create an ObsClient instance.
    var obsClient = new ObsClient({
        // Hard-coded or plaintext AK/SK are risky. For security purposes, encrypt your AK/SK and store them in the configuration file or environment variables. In this example, the AK/SK are stored in environment variables for identity authentication. Before running this example, configure environment variables AccessKeyID and SecretAccessKey.
        // The front-end code does not have the process environment variable, so you need to use a module bundler like webpack to define the process variable.
        // Obtain an AK/SK pair on the management console. For details, see https://support.huaweicloud.com/intl/en-us/usermanual-ca/ca_01_0003.html.
        access_key_id: process.env.AccessKeyID,
        secret_access_key: process.env.SecretAccessKey,
        // Replace the example endpoint with the actual one in your case.
        server: 'https://obs.ap-southeast-1.myhuaweicloud.com'
    });
    // Use the resumable upload API of the SDK to upload files.
    obsClient.uploadFile({
       // Transfer the request parameter.
    }, function (err, result) {
       // Process the callback function.
    });

NOTE:

The size of a file for browser-based upload cannot exceed 5 GB.

Undefinition Caused by the Introduction of the CommonJS Specification

Uncaught (in promise) TypeError: Cannot read property 'CancelToken' of undefined

The cause is that a modular component of the CommonJS specification is introduced to the program, such as webpack. Solution: Upgrade the SDK to 3.19.5 or a later version.

Undefinition Caused by the Introduction of Mock.js

Uncaught TypeError: request.upload.addEventListener in not a function

The cause is that the Mock.js component is used to stub XHR in the program. The solutions are as follows:

  1. Workaround: Disable the progress bar function when the SDK is used for upload, download, and resumable upload.
  2. Replace: Replace the Mock.js component with a component that can simulate all XHR interfaces.
  3. Extend: Extend the Mock.js component by supplementing the Mock.js interfaces that do not support XHR.

Kami menggunakan cookie untuk meningkatkan kualitas situs kami dan pengalaman Anda. Dengan melanjutkan penelusuran di situs kami berarti Anda menerima kebijakan cookie kami. Cari tahu selengkapnya

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback