Category Archives: Error

Mongodb error: authentication failed [How to Solve]

Error Messages:

Database connect error:

com.mongodb.MongoSecurityException: Exception authenticating MongoCredential{mechanism=SCRAM-SHA-1, userName=‘root’, source=‘gateway’, password=, mechanismProperties=} Command failed with error 18 (AuthenticationFailed): ‘Authentication failed.’ on server 192.168.81.13:27017. The full response is {“ok”: 0.0, “errmsg”: “Authentication failed.”, “code”: 18, “codeName”: “AuthenticationFailed”}.

 

Solution:

Connect URL

mongodb://user:password@host:port/dbname

Add parameter authsource

For example:

mongodb://user:password@host:port/dbname?authSource=admin

In general, authsource is admin and can be replaced as needed

[Solved] Android Studio Start Error: Missing essential plugin: org.jetbrains.android Please reinstall Android

When the update is completed, Android studio reports an error: missing essential plugin: org jetbrains. android Please reinstall Android

Illustration

solution: delete C:\users\Lenovo\appdata\roaming\Google\androidstudio20203\disabled_plugins.txt,

If you can’t find the above file, set it as a hidden folder. You can’t see and view the hidden file until it is set

[Solved] docker Error: bridge docker0 failed: exchange full

Error reported: Bridge docker0 failed: exchange full

the default docker0 bridge only supports 1024 links. If it exceeds 1024, it will report bridge docker0 failed: exchange full

you can remove the restriction by creating another network bridge. When docker run creates a container, you specify our own network bridge. Of course, we only support 1024 network bridges. You can use this method to create unlimited network bridges as long as there is enough memory to create a docker container

1. View Bridge

[root@bj ~]# docker network ls
NETWORK ID     NAME      DRIVER    SCOPE
0c49b2d827f5   bridge    bridge    local
8ec28361848f   host      host      local
3b929af4064c   none      null      local

2. Create Bridge

[root@bj ~]# docker network create xinnet
[root@bj ~]# docker network ls
NETWORK ID     NAME      DRIVER    SCOPE
0c49b2d827f5   bridge    bridge    local
8ec28361848f   host      host      local
3b929af4064c   none      null      local
604ccc72661a   xinnet    bridge    local
[root@bj ~]# docker network inspect xinnet
[
    {
        "Name": "xinnet",
        "Id": "604ccc72661af52f0889bfea4664d70e899427418b1a9301d8a46e6ce95e46ee",
        "Created": "2021-12-08T13:50:43.973901095+08:00",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": {},
            "Config": [
                {
                    "Subnet": "172.19.0.0/16",
                    "Gateway": "172.19.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "e92f81a6fe11b6e2c82de38fbe4e06a9cfcdb1dcd1f64485e5b805e3714bd163": {
                "Name": "zabbix-agent-22000",
                "EndpointID": "b7ac1a57b2e91435c676a7b4203ab50237893a3714aff185d8cdac45b1251356",
                "MacAddress": "02:42:ac:13:00:02",
                "IPv4Address": "172.19.0.2/16",
                "IPv6Address": ""
            }
        },
        "Options": {},
        "Labels": {}
    }
]

3. Create container specified bridge – network

[root@bj ~]# docker run -m 100m --name zabbix-agent-22001 --network=xinnet -e HOSTNAME="TEST22001" -e ZBX_HOSTNAME="TEST22001" -e ZBX_SERVER_HOST="10.20.9.246" -p 22001:10050 -e ZBX_SERVER_PORT=10051 -d zabbix-agent:4.0.35 
[root@bj ~]# docker ps -a
CONTAINER ID   IMAGE                 COMMAND                  CREATED          STATUS          PORTS                      NAMES
e92f81a6fe11   zabbix-agent:4.0.35   "/usr/bin/tini -- /u…"   15 minutes ago   Up 15 minutes   0.0.0.0:22001->10050/tcp   zabbix-agent-22001

If – network is not specified, the created containers will be hung on docker0 by default, and the IP of docker0 interface on the local host will be used as the default gateway for all containers

[Solved] jetson nano Error: Illegal instruction(core dumped)

Jetson nano reported an error: legal instruction (core dumped)


Problem Description: it is not easy to replace the image source and configure the remote xrdp desktop for the Jetson nano development board (refer to my previous blog posts). When the project is deployed and running, the following errors do occur:

Illegal instruction(cpre dumped)

There is no way but to continue to check the data. The solution is as follows:

1. Terminal operation

sudo gedit ~/.bashrc

2. Add environment variables at the end, save and close the file

export OPENBLAS_CORETYPE=ARMV8

3. The terminal runs source ~/bashrc

run in the terminal: source ~/.bashrc

I restart it and then I can. Some blogs say that it is related to dependent packages in the environment

[Solved] jedis Error: Could not get a resource from the pool

The local Java program operates the redis service in the virtual machine and reports an error.

Solution:
1. check whether Linux in the local and VMware virtual machines can ping each otherwhen the Ping fails, it is usually the problem of setting the network adapter of the virtual machine. Refer to the correct configuration: 1) right click virtual machine -> Settings -> network adapter -> bridge mode. 2) Set IP4 in VMnet1 in the local network connection to automatic acquisition. 3) Set the network card of the virtual machine to get automatically. 4) Turn off the firewall of the local and virtual machines,

2. check whether redis can start normally, if it does not start normally, check the cause of the error through the log,

3. check whether the Java program reads the redis related configuration correctly, when reading the configuration, the field spelling error may cause the connection to redis to fail.

For example, @Value ("${spring.redis.host}")
host is written as port

[Solved] Navicat Connect Error: Oracle library is not loaded.

Navicat connection error – Oracle library is not loaded

Error reason: OCI. Of Navicat installation package There is a problem with the DLL

Solution: Download instantclient basic windows on the official website of Oracle x64-11.2.0.4.0.zip

Note that the version should be the same as Navicat –> Tools –> Options –> Environment –> OCI environment –> oci. The version information in the address of DLL is consistent

Finally, restart Navicat

[Solved] React Native Red screen Error: Unable to load script from assets

If the above error occurs, first confirm whether the RN service runs successfully

In some cases, the startup fails, or it is shut down unexpectedly after startup, or the ports are inconsistent.

Another situation is recorded here:

If it is a project from the new cluster on GitHub, the directory of Android\app\SRC\main\assets may be empty (the assets folder needs to be created). At this time, it needs to be run under the terminal of the project root directory:

react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/ 

To create the missing file

After running, you will see the missing index on the red screen android. Bundle file.

Run it again and the problem is solved.

[Solved] Project Upgrade Gradle error (Bugly is integrated)

What went wrong: A problem occurred configuring project ‘:app’.
Failed to notify project evaluation listener.
No signature of method: org.gradle.api.internal.file.DefaultFilePropertyFactory$DefaultDirectoryVar.getFiles() is applicable for argument types: () values: [] Possible solutions: getAsFile(), getOrElse(java.lang.Object), getOrElse(java.lang.Object), getClass(), getType(), file(java.lang.String) > can’t find tinkerProcessReleaseManifest, you must init tinker plugin first!

Solution:
Go back to the original Gradle setup
Check the build.gradle file in the project

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.2'
        classpath "com.tencent.bugly:tinker-support:1.1.5"
    }

Put classpath “classpath ‘com.android.tools.build:gradle:3.5.2’’ is modified to the original version [modified at this time]
bugly is not compatible with the higher version of gradle. Basically, it should be in 3 X version
also, check the gradle folder under the app directory, open the wrapper folder, and find the gradle-wrapper.properties file
changes the distributionurl to the original version.

[Solved] Stream Error: stream has already been operated upon or closed

public class StreamTest {
    public static void main(String[] args) {
        //Generate a Stream of type String
        Stream<String> stringStream = Stream.of("1", "2", "3", "4", "5");
        // Convert string type in stream to int type using map method
        stringStream.map(
                (String s) ->{
                    return Integer.parseInt(s);
                });
        stringStream.forEach(i -> System.out.println(i));
    }
}

As shown in the figure, the code runs with an error:

The stream has been used or closed

This is a feature of streams: a stream can only be used once!

[Solved] SpringBoot Error: HttpMediaTypeNotSupportedException: Content type ‘application/json‘ not supported

HttpMediaTypeNotSupportedException: Content type ‘application/json;charset=UTF-8’ not supported
Error:

{
    "timestamp": "2021-12-13T11:49:33.305+00:00",
    "status": 415,
    "error": "Unsupported Media Type",
    "path": "/api/v1/product/add"
}

If you are sure that there is no problem with your parameters, it is likely that the problem lies in your @requestbody AAA a
the problem I encounter here is that protobuf is used, but no corresponding bean is injected, resulting in an error. Just add the following code to the application:

PS: protobufmodule is our own extended com fasterxml.jackson.databind.Module class, it’s inconvenient to put it out. You can consult the data by yourself

    @Bean
    ProtobufJsonFormatHttpMessageConverter protobufHttpMessageConverter() {
        return new  ProtobufJsonFormatHttpMessageConverter();
    }

    @Bean
    public Jackson2ObjectMapperBuilderCustomizer jsonCustomizer() {
        return builder -> builder.serializationInclusion(JsonInclude.Include.NON_NULL)
                .modules(new ProtobufModule(), new JavaTimeModule());
    }

[Solved] Ubuntu uses gym to save the video error: “unknown encoder ‘libx264′”

In the experiment of using gym environment to train the agent and save the video locally, an error was encountered when using monitor to save the video:

Unknown encoder 'libx264'

Considering that the video saved in gym is saved in ffmpeg, I reinstalled it, but still reported an error. Then yes

check the original codes ofwrappers.Monitor

Here we judge the selection method, so we can choose other encoders to save our video. We just need to install CONDA, uninstall ffmpeg, and then use other options


import pkgutil
import distutils.spawn
import imageio_ffmpeg

print(distutils.spawn.find_executable("avconv"))
print(distutils.spawn.find_executable("ffmpeg"))
print(pkgutil.find_loader("imageio_ffmpeg"))
print(imageio_ffmpeg.get_ffmpeg_exe())

In my case, after I uninstall ffmpeg in CONDA, what gym calls becomes ffmpeg installed in Ubuntu, and then it can run.