Tag Archives: huawei

[Solved] ENSP Failed to Start AR Device error code: 40

Errors are reported as follows:

My configuration is as follows:

ENSP-1.3

Virtualbox-5.2.32 (only version 5.0-5.2 can be used)

Wireshark-win64-3.0.3

My problem is solved as follows:

First, make sure that the installation paths of the reference tools are on Disk C

Those not in the C disk are reinstalled to the C disk, otherwise there is a high probability of error.

Then import the device package

When you drag it out and start it, you can add a device package. At this time, you can add a device package with the suffix img.

Registering an AR device

Follow the prompts on the help document to register the device.

Select all AR devices and register them.

After registration, exit and restart ENSP.

Inspection

Start successful.

[Solved] Huawei OBS Python SDK download picture error: nosuchkey

Background:

In the past, Huawei OBS was used to download pictures (that is, to view pictures through a browser), and the address was used to access OBS directly.
for example,
endpoint: obs-example-domain.cn
picture name: QCX% 2F1% 2f20210804% 2f2db3c4bb-0c2c-4c3c-84e0-7e131c1e8db61628047890560.jpg

Access address:

http://obs-example-domain.cn/qcx%2F1%2F20210804%2F2db3c4bb -0c2c-4c3c-84e0-7e131c1e8db61628047890560. jpg

WGet can download pictures from the above address.

However, if you use Python SDK to access, an error will be reported:


AK = 'PLAU4DD8EYVXSA****UL'
SK = 'MdNZCKgSwt9Qgq6ZXtaF7wtZOd8********xEiv'
server = "http://obs-example-domain.cn"
bucketName = 'qcx'
obsClient = ObsClient(access_key_id=AK, secret_access_key=SK, server=server)
name = "qcx%2F1%2F20210804%2F2db3c4bb-0c2c-4c3c-84e0-7e131c1e8db61628047890560.jpg"
resp = obsClient.getObject(bucketName, name, loadStreamInMemory=True)
print(resp.body)

Output: the specified key does not exist

In the above procedures: name = QCX% 2F1% 2f20210804% 2f2db3c4bb-0c2c-4c3c-84e0-7e131c1e8db61628047890560 jpg

Solution:

The picture name above is actually URLEncode. The original string urlcode can obtain:

qcx/1/20210804/2db3c4bb-0c2c-4c3c-84e0-7e131c1e8db61628047890560. jpg

Change the name in the above code to the picture name after URLDecode, that is:

name = "qcx/1/20210804/2db3c4bb-0c2c-4c3c-84e0-7e131c1e8db61628047890560.jpg"

You can get the picture correctly.

The function completion code

Picture browsing completed line:

Browser request img URL -> nginx -> API (with SK AK) – > obs -> Response API – > nginx -> browser

Python 2.7 (only this version is available on the server and cannot be upgraded to 3.X)

#coding=utf-8
from BaseHTTPServer import BaseHTTPRequestHandler
import urllib
import cgi
import os
import urllib
# print urllib.unquote('%E4%B8%89%E7%94%9F%E4%B8%89%E4%B8%96')

from obs import ObsClient

AK = 'PLAU4DD8EYVXSA****UL'
SK = 'MdNZCKgSwt9Qgq6ZXtaF7wtZOd8********xEiv'
server = "http://obs.cn-dchlw-1.digitalgd.com.cn"
bucketName = 'qcxx'
obsClient = ObsClient(access_key_id=AK, secret_access_key=SK, server=server)

cwd = os.getcwd()

class ObsHandler(BaseHTTPRequestHandler):
    def do_GET(self):
        path = urllib.unquote(self.path)
        buf = ""
        query_list = path.split("/")  #auto urldecode
        #print(query_list)
        if query_list[1] == "obs":
            name = "/".join(query_list[3:]).replace("?","")   # for online
            #name = urllib.unquote(name)
            resp = obsClient.getObject(bucketName, name, loadStreamInMemory=True)
            if resp.status < 300: 
                self.send_response(200) 
                buf = resp.body.buffer
            else: 
                self.send_response(400)
        self.end_headers()
        self.wfile.write(buf)
       
 
def StartServer():
    from BaseHTTPServer import HTTPServer
    sever = HTTPServer(("",12000),ObsHandler)
    sever.serve_forever()
  
  
if __name__=='__main__':
    StartServer()

[ERROR_BUNDLE_PATH_OR_FILE] & Error while Deploying HAP

Harmony App installation error on real machine:[ERROR_BUNDLE_PATH_OR_FILE] & Error while Deploying HAP
Error Messages:

Launching com.mosr.myapplication
$ hdc shell am force-stop com.mosr.myapplication
$ hdc shell bm uninstall com.mosr.myapplication
$ hdc file send F:\HarmonyProjects\MyApplication\list\build\outputs\hap\debug\list-entry-debug-rich-signed.hap /sdcard/c238ee6328cc48d69d0471eb05eff6e7/list-entry-debug-rich-signed.hap
$ hdc shell bm install -p /sdcard/c238ee6328cc48d69d0471eb05eff6e7/
[ERROR_BUNDLE_PATH_OR_FILE]
$ hdc shell rm -rf /sdcard/c238ee6328cc48d69d0471eb05eff6e7
Error while Deploying HAP

Tester: Huawei mate9, harmony OS2 0.0 (version No.: 2.0.0.125)

There is no solution, and the system version does not support it. It is recommended to use remote virtual machines and remote real machines in harmony OS device manager.

Error: Please renew the default configurations. [How to Solve]

Problems arising

The current configuration is shown in the following figure:

[SW1]int g0/0/1
[SW1-GigabitEthernet0/0/1]
[SW1-GigabitEthernet0/0/1]dis this
#
interface GigabitEthernet0/0/1
 port link-type trunk
 undo port trunk allow-pass vlan 1
 port trunk allow-pass vlan 2 to 4094
#
return

When the port link type needs to be modified or deleted, an error is reported   Error: please update the default configuration

[SW1-GigabitEthernet0/0/1]
[SW1-GigabitEthernet0/0/1]port link-type access 
Error: Please renew the default configurations.
[SW1-GigabitEthernet0/0/1]
[SW1-GigabitEthernet0/0/1]undo port link-type 
Error: Please renew the default configurations.

Causes of occurrence

The reason for the error is that you have added the port to a VLAN, so you will report an error when changing or deleting it.

For example, if you want to delete “parent folder”, you have to delete “child folder” first. It means to delete it layer by layer. The same is true of Huawei’s configuration commands, which are undo level by level.

|--Parent Folder
|---- subfolder

Solution

To undo all commands except “port link type trunk”, you can change the link type or undo the command.

[SW1-GigabitEthernet0/0/1]dis this
#
interface GigabitEthernet0/0/1
 port link-type trunk
 undo port trunk allow-pass vlan 1
#
return
[SW1-GigabitEthernet0/0/1]
[SW1-GigabitEthernet0/0/1]undo port trunk allow-pass vlan all
[SW1-GigabitEthernet0/0/1]
[SW1-GigabitEthernet0/0/1]port trunk allow-pass vlan 1
[SW1-GigabitEthernet0/0/1]
[SW1-GigabitEthernet0/0/1]dis this
#
interface GigabitEthernet0/0/1
 port link-type trunk
#
return
[SW1-GigabitEthernet0/0/1]
[SW1-GigabitEthernet0/0/1]undo port link-type 
[SW1-GigabitEthernet0/0/1]
[SW1-GigabitEthernet0/0/1]dis this
#
interface GigabitEthernet0/0/1
#
return

Huawei kafka Authentication error: Server not found in Kerberos database (7) – LOOKING_UP_SERVER

Error reporting original text

principal is [email protected]
Will use keytab
Commit Succeeded 

21/08/23 10:20:14 INFO NewConsumer: subscribe:bc_test
Exception in thread "main" java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
Caused by: org.apache.kafka.common.errors.SaslAuthenticationException: An error: (java.security.PrivilegedActionException: javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Server not found in Kerberos database (7) - LOOKING_UP_SERVER)]) occurred when evaluating SASL token received from the Kafka Broker. Kafka Client will go to AUTHENTICATION_FAILED state.
Caused by: javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Server not found in Kerberos database (7) - LOOKING_UP_SERVER)]
	at com.sun.security.sasl.gsskerb.GssKrb5Client.evaluateChallenge(GssKrb5Client.java:211)
	at org.apache.kafka.common.security.authenticator.SaslClientAuthenticator$2.run(SaslClientAuthenticator.java:361)
	at org.apache.kafka.common.security.authenticator.SaslClientAuthenticator$2.run(SaslClientAuthenticator.java:359)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:422)
	at org.apache.kafka.common.security.authenticator.SaslClientAuthenticator.createSaslToken(SaslClientAuthenticator.java:359)
	at org.apache.kafka.common.security.authenticator.SaslClientAuthenticator.sendSaslClientToken(SaslClientAuthenticator.java:269)
	at org.apache.kafka.common.security.authenticator.SaslClientAuthenticator.authenticate(SaslClientAuthenticator.java:206)
	at org.apache.kafka.common.network.KafkaChannel.prepare(KafkaChannel.java:81)
	at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:486)
	at org.apache.kafka.common.network.Selector.poll(Selector.java:424)
	at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:460)
	at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:261)
	at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:233)
	at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:209)
	at org.apache.kafka.clients.consumer.internals.AbstractCoordinator.ensureCoordinatorReady(AbstractCoordinator.java:219)
	at org.apache.kafka.clients.consumer.internals.AbstractCoordinator.ensureCoordinatorReady(AbstractCoordinator.java:205)
	at org.apache.kafka.clients.consumer.internals.ConsumerCoordinator.poll(ConsumerCoordinator.java:279)
	at org.apache.kafka.clients.consumer.KafkaConsumer.pollOnce(KafkaConsumer.java:1149)
	at org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:1115)
	at receive.NewConsumer.doWork(NewConsumer.java:102)
	at receive.NewConsumer.main(NewConsumer.java:127)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
	at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
Caused by: GSSException: No valid credentials provided (Mechanism level: Server not found in Kerberos database (7) - LOOKING_UP_SERVER)
	at sun.security.jgss.krb5.Krb5Context.initSecContext(Krb5Context.java:770)
	at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:248)
	at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:179)
	at com.sun.security.sasl.gsskerb.GssKrb5Client.evaluateChallenge(GssKrb5Client.java:192)
	... 29 more
Caused by: KrbException: Server not found in Kerberos database (7) - LOOKING_UP_SERVER
	at sun.security.krb5.KrbTgsRep.<init>(KrbTgsRep.java:73)
	at sun.security.krb5.KrbTgsReq.getReply(KrbTgsReq.java:251)
	at sun.security.krb5.KrbTgsReq.sendAndGetCreds(KrbTgsReq.java:262)
	at sun.security.krb5.internal.CredentialsUtil.serviceCreds(CredentialsUtil.java:308)
	at sun.security.krb5.internal.CredentialsUtil.acquireServiceCreds(CredentialsUtil.java:126)
	at sun.security.krb5.Credentials.acquireServiceCreds(Credentials.java:458)
	at sun.security.jgss.krb5.Krb5Context.initSecContext(Krb5Context.java:693)
	... 32 more
Caused by: KrbException: Identifier doesn't match expected value (906)
	at sun.security.krb5.internal.KDCRep.init(KDCRep.java:140)
	at sun.security.krb5.internal.TGSRep.init(TGSRep.java:65)
	at sun.security.krb5.internal.TGSRep.<init>(TGSRep.java:60)
	at sun.security.krb5.KrbTgsRep.<init>(KrbTgsRep.java:55)
	... 38 more

 

Solution:

After troubleshooting the error reported by connecting to Huawei big data platform, it was found that the Kerberos authentication passed, because the words will use KeyTab commit succeeded appeared, and there was an exception message when creating a consumer. The methods on the Internet have been tried, such as configuring hosts, checking the generated jaas.conf file, comparing krb5 files, etc
finally, replace Kafka’s dependent package with Huawei’s three packages (Kafka)_ 2.11-1.1.0.jar, kafka-clients-1.1.0.jar, zookeeper-3.5.1. Jar) passed!

Maven local package

Maven’s command to install jar package is:
MVN install: install file
– dfile = jar package location
– dgroupid = groupid in POM file
– dartifactid = artifactid in POM file
– dversion = version in POM file
– dpacking = jar

mvn install:install-file -Dfile=./kafka_2.11-1.1.0.jar -DgroupId=org.apache.kafka -DartifactId=kafka_2.11 -Dversion=1.1.0-hw -Dpackaging=jar

Maven introduction

       <dependency>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka_2.11</artifactId>
            <version>1.1.0-hw</version>
        </dependency>

[Solved] Error while deploying HAP reported by Hongmeng deveco studio

It’s been a long time since I used DevEco-Studio, and today I ran a demo that reported an error, which I didn’t want to do.
Error message.
$ hdc file send /Users/likai/DevEcoStudioProjects/player/entry/build/outputs/hap/debug/entry-debug-unsigned.hap /sdcard/1bde11bbf51f4783a54e2e3616f6a0cd/entry-debug-unsigned.hap
$ hdc shell bm install -p /sdcard/1bde11bbf51f4783a54e2e3616f6a0cd/
Failure[INSTALL_PARSE_FAILED_USESDK_ERROR]
$ hdc shell rm -rf /sdcard/1bde11bbf51f4783a54e2e3616f6a0cd
Error while Deploying HAP
Solution.
Find the project’s configuration file config.json, open it and delete “releaseType”: “Beta1” , then run the perfect solution

Finding the longest connection path of a string

Topic describes
Given n strings, arrange n strings in lexicographic order.
The input describing
Enter the first action with a positive integer N (1≤n≤1000), and the following action with n strings (string length ≤100), which contain only upper and lower case letters.
Output description
The data outputs n lines of a lexicographical string.
The sample
Type :
9
cap
to
cat
two
too
up
boat
boot

boat
boot
cap
card
cat
to
too
two
up
Train of thought
The container Set can insert elements into the container at any time, quickly find elements at any time, and need to be traversed in some order. Multiset is an extension of set. Compared with set, multiset contains duplicate elements, that is, set considers key-like elements as the same element, and for counting +1, multiset considers key-like elements as equivalent elements and stores them in turn. Insert the input word into the container multiset in some order, and then print out the elements in the container.

#include <iostream>
#include <set>
using namespace std;
int main(){
    int n;
    cin>>n;
    string input;
    multiset<string> arr;
    while(n--){
        cin>>input;
        arr.insert(input);
    }
    for(auto myarr:arr){
        cout<<myarr<<endl;
    }
    return 0;
}

Using the container Vector, input strings are pressed into the container one by one, and the elements in the container are sorted after all are pressed.

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
bool compare(string str1,string str2){
    return str1<str2;
}
int main(){
    int n;
    cin>>n;
    string input;
    vector<string> arr;
    while(n--){
        cin>>input;
        arr.push_back(input);
    }
    sort(arr.begin(),arr.end(),compare);
    for(int i=0;i<arr.size();i++){
        cout<<arr[i]<<endl;
    }
    return 0;
}

##Configure VLAN partition based on IP subnet

By configuring the VLAN based on IP subnet, the packet sent by the specified network segment or IP address is transmitted in the specified VLAN, which reduces the initial configuration task of the network administrator and facilitates the management. has a variety of businesses, such as IPTV, VoIP, Internet, etc. Each business USES different IP addresses. In order to facilitate management, it is necessary to divide the same type of business into the same VLAN and different types of business into different VLans.
Switch receives user messages including data, IPTV, voice and other services. The IP address
address of user devices is different. Now it is necessary to divide different types of business into different vlans and shunt them to different remote servers
through different VLAN ids to achieve business interoperability.
configuration idea
USES the following idea to configure the VLAN based on IP subnet partition:
creates a VLAN to determine the VLAN to which each service belongs.
associates IP subnets and vlans. The
switch determines the VLAN based on the source IP address or the specified network segment in the message. New sites do not need much
configuration when they are connected to the network, and switches automatically partition each site into a different VLAN based on its network address.
allows IP subnetwork-based vlans to pass through the current port.
configure the priority of VLAN partitioning to ensure that the priority is selected to divide the VLAN based on the IP subnet.
enables VLAN partitioning based on IP subnet.
data preparation
to complete this configuration example, prepare the following data.
configuration interface ge0/0/1 is untagged with VLAN100, VLAN200 and VLAN300.
configuration interface ge0/0/2, ge0/0/3 and ge0/0/4 are tagged with VLAN100, VLAN200
and VLAN300, respectively. Create VLAN
create VLAN100, VLAN200, and VLAN300 on the Switch.
system-view
[Quidway] vlan batch 100 200 300
configuration interface
configure interface ge0/0/1 on Switch as Hybrid type, and add VLAN100, VLAN200 and
VLAN300.
[Quidway] interface gigabitethernet 0/0/1
[Quidway-GigabitEthernet0/0/1] port link-type hybrid
[Quidway-GigabitEthernet0/0/1] port hybrid untagged vlan 100 200 300
[quidway-gigabitethernet0/0/1] quit
configure the interface ge0/0/2 on the Switch to join VLAN100.
[Quidway] interface gigabitethernet 0/0/2
[Quidway-GigabitEthernet0/0/2] port link-type trunk
[Quidway-GigabitEthernet0/0/2] port trunk allow-pass vlan 100
[quidway-gigabitethernet0/0/2] quit
configure the interface ge0/0/3 on the Switch to join VLAN200.
[Quidway] interface gigabitethernet 0/0/3
[Quidway-GigabitEthernet0/0/3] port link-type trunk
[Quidway-GigabitEthernet0/0/3] port trunk allow-pass vlan 200
Quidway-gigabitethernet0/0/3] quit
configure the interface ge0/0/4 on the Switch to join VLAN300.
[Quidway] interface gigabitethernet 0/0/4
[Quidway-GigabitEthernet0/0/4] port link-type trunk
[Quidway-GigabitEthernet0/0/4] port trunk allow-pass vlan 300
Quidway-gigabitethernet0/0/4] quit
configure the interface ge0/0/1 on the Switch so that VLAN function can be divided based on IP subnet.
[Quidway] interface gigabitethernet 0/0/1
[quidway-gigabitethernet0/0/1] enable
[quidway-gigabitethernet0/0/1] quit
configuration based on IP subnet partition vlan
to configure VLAN100 and IP address on the Switch 192.168.1.2 Association, priority 2.
[Quidway] vlan100
[quidway-vlan100] ip-subnet-vlan 1 IP 192.168.1.2 24 priority 2
[quidway-vlan100] quit
configure VLAN200 to be associated with IP address 192.168.2.2 on the Switch with priority 3.
[Quidway] vlan200
[quidway-vlan200] ip-subnet-vlan 1 IP 192.168.2.2 24 priority 3
[quidway-vlan200] quit
configure VLAN300 to associate with IP address 192.168.3.2 on the Switch with priority 4.
[Quidway] vlan300
[Quidway] vlan 1 IP 192.168.3.2 24 priority 4
[quidway-vlan300] quit
verify configuration result
execute the following command on the Switch
[Quidway] display ip-subnet-vlan vlan all