Category Archives: How to Fix

How to Solve MacOS ffmpeg killed Error


tags: MacOS Debug Tips

Question

Recently, I wanted to download the live playback course in nailing with the tried and true method, but some errors suddenly appeared when executing ffmpeg on the command line:

[1]    40344 killed     ffmpeg

 

Solution:

This problem can be solved by compiling and installing from the source code through the following command

brew tap homebrew-ffmpeg/ffmpeg
brew install homebrew-ffmpeg/ffmpeg/ffmpeg

At this time, enter ffmpeg in the terminal to get:

❯ ffmpeg
ffmpeg version 5.0 Copyright (c) 2000-2022 the FFmpeg developers
  built with Apple clang version 13.1.6 (clang-1316.0.21.2)
  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/5.0-with-options_2 --enable-shared --cc=clang --host-cflags= --host-ldflags= --enable-gpl --enable-libaom --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-libsnappy --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-demuxer=dash --enable-opencl --enable-videotoolbox --enable-neon --disable-htmlpages
  libavutil      57. 17.100/57. 17.100
  libavcodec     59. 18.100/59. 18.100
  libavformat    59. 16.100/59. 16.100
  libavdevice    59.  4.100/59.  4.100
  libavfilter     8. 24.100/ 8. 24.100
  libswscale      6.  4.100/ 6.  4.100
  libswresample   4.  3.100/ 4.  3.100
  libpostproc    56.  3.100/56.  3.100
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

How to Solve Gbase 8A Troubleshooting (rhel7 start CGroup error)

Problem
RHEL7 starts cgroup with an error Filed to start cgconfig.service:Unit not found.
Steps
Step 1
Check if the following installation packages are installed, if they are missing, please install them.

libcgroup-0.41-8.el7.x86_64.rpm
libcgroup-tools-0.41-8.el7.x86_64.rpm

Step 2
Set up the cgroup service to start on boot after installation.

systemctl enable cgconfig.service

Step 3
Start the cgconfig service.

systemctl start cgconfig.service

[Solved] kubelet Startup Error: cannot find network namespace for the terminated container

1. Error reporting:

Use the journalctl – xefu kubelet command to view the kubelet log. The following errors are found:

cannot find network namespace for the terminated container

2. Solution:

# docker system prune

# systemctl restart kubelet

Instructions for using docker system:

# docker system -h

Flag shorthand -h has been deprecated, please use –help

Usage: docker system COMMAND

Manage Docker

Commands:

df             Show docker disk usage

Check the usage of docker space.

events     Get real time events from the server

View live events.

info         Display system-wide information

View system information.

prune     Remove unused data

Docker cleans the stopped container, and there is no network, image and cache used by the container.

Mybatis-plus automatically generates code error [Solved]

09:39:23.593 [main] DEBUG com.baomidou.mybatisplus.generator.AutoGenerator - ==========================准备生成文件...==========================
Exception in thread "main" java.lang.NoClassDefFoundError: freemarker/template/Configuration
at com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine.init(FreemarkerTemplateEngine.java:41)
at com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine.init(FreemarkerTemplateEngine.java:34)
at com.baomidou.mybatisplus.generator.AutoGenerator.execute(AutoGenerator.java:103)
at com.dream.road.CodeGenerator.main(CodeGenerator.java:136)
Caused by: java.lang.ClassNotFoundException: freemarker.template.Configuration
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

Solution:

Dependencies that need to be imported for automatic code generation

        <!--mybatis-plus automatically generates code-->
        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-generator</artifactId>
            <version>3.5.1</version>
        </dependency>
        <dependency>
            <groupId>org.apache.velocity</groupId>
            <artifactId>velocity-engine-core</artifactId>
            <version>2.2</version>
        </dependency>
        <dependency>
            <groupId>org.freemarker</groupId>
            <artifactId>freemarker</artifactId>
            <version>2.3.28</version>
            <scope>compile</scope>
        </dependency>

[Solved] Redis Startup Error: QForkMasterInit: system error caught. error code=0x000005af

 

1. Problems

When you use redis-server.exe to startup directly, it will flashback. When it is started with script and configuration file, it will also flashback. When it is started with command line, an error will be reported:

[23848] 16 Mar 16:10:32.565 # QForkMasterInit: system error caught. error code=0x000005af, message=VirtualAllocEx failed.: unknown error

2. Solutions

Redis’s conf file sets the parameters maxheap and maxmemory

maxmemory 120MB

maxheap 180MB

Maxmemory and maxheap depend on your computer configuration. Usually: maxheap = 1.5 * maxmemory

[Solved] error: link.exe‘ failed with exit status 1158

Error Messages:

bug error: command ‘\XXX\VS2015\VC\BIN\x86_amd64\link.exe‘ failed with exit status 1158

 

Solution:

Because some of the previous system configurations are gone, reinstall things such as vs and buildtools, but there are many problems in the installation process, and there are always missing things. Record the contents that are difficult to find here
prompt error when the program is running: error: command ‘\XXX\VS2015\VC\BIN\x86_amd64\link.exe‘ failed with exit status 1158
background display
I read the online solution, that is, vs is missing two files rc.exe and rcdl.dll can’t run, but I can’t find these two files according to the online path
the path of others is:
C:\Program Files(×86)Windows Kits\8.1\bin\×86
I found it in this path
C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x64
or
C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86
both can be used
in short, these two files are rc.exe andrcdl.dll must be in the path of C:\Program Files (x86)\Windows Kits, but the location of different system configurations may be different. This is probably related to some things you installed. Look carefully

then copy the two files to
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64

Or C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin
you can solve the problem by installing Microsoft Visual Studio 14.0

Asynchronous Future Parallel processing request code example

The thread pool is implemented in cooperation with future, but the main request thread is blocked. High concurrency will still cause too many threads. CPU context switching. Through future, n requests can be sent concurrently, and then wait for the slowest return. The total response time is the time returned by the slowest request

public class Test{
  
  final static ExecutorService executor = Executors.newFixedThreadPool(2);

  public static void main(String[] args){
    RpcService rpcService = new RpcService();
    HttpService httpService = new HttpService();
    Future<Map<String,String>> future1 = null;
    Future<Integer> future2 = null;
    try{
      future1 = executor.submit(()->rpcService.getRpcResult());
      future2 = executor.submit(()->httpService.getHttpResult());
    }catch(Exception e){
       if(future1 != null){
         future1.cancel(true);
       }
       if(future2 != null){
         future2.cancel(true);
       }
       throw new RuntimeEException(e);
    }
  }
  
  static class RpcService{
    Map<String,String> gerRpcResult() throws Exception{
      //Calling remote methods, taking 10ms
    }
  }

  static class HttpService{
    Integer getHttpResult() throws Exception{
      //Calling remote methods, taking 30ms
    }
  }
}

[Solved] nacos Startup Error: java.io.IOException…

tip: here is a brief description of the project background:

Problem Scenario: Error on startup after installing nacos

Problem description

tip: describe the project here

Nacos startup error

Cause analysis:

Nacos defaults to cluster startup. Here is a startup error in the windows stand-alone environment

Solution:

Line 26 Modify set MODE="cluster" to MODE="standalone" and the problem is solved

[Solved] Android Gradle configure error: Location: Class buildconfig

Error message:

D:\002_Project\002_Android_Learn\ClassLoader_Demo\app\build\generated\source\buildConfig\debug\com\example\classloader_demo\BuildConfig.java:15: Error: Symbol not found
  public static final String market = GooglePlay;
                                      ^
  Symbol: Variable GooglePlay
  Location: Class BuildConfig

In the gradle.properties configuration file in the root of the Android Studio project, configure as:

# Configure whether to be on Google Play
isGooglePlay=true
# Configure the current app marketplace
market=GooglePlay

The corresponding configuration in build.gradle is as follows :

android {

    defaultConfig {
        // Whether the app is available on Google Play
        buildConfigField("boolean", "isGooglePlay", isGooglePlay)
        // The current app marketplace
        buildConfigField("String", "market", market)
    }
}

The generated BuildConfig.java configuration is as follows :

/**
 * Automatically generated file. DO NOT MODIFY
 */
package com.example.classloader_demo;

public final class BuildConfig {
  public static final boolean DEBUG = Boolean.parseBoolean("true");
  public static final String APPLICATION_ID = "com.example.classloader_demo";
  public static final String BUILD_TYPE = "debug";
  public static final int VERSION_CODE = 1;
  public static final String VERSION_NAME = "1.0";
  // Field from default config.
  public static final boolean isGooglePlay = true;
  // Field from default config.
  public static final String market = GooglePlay;
}

The last googleplay string has no double quotation marks, resulting in an error;

 

2. Solution

use

buildConfigField("String", "market", "\"${market}\"")

Groovy code , you can generate the following configuration in BuildConfig.java :

public static final String market = "GooglePlay";

The double quotes in the string need to be added with their own escape characters, otherwise they are invalid;

The first level of double quotes in “\”${market}\”” is because the buildConfigField function requires three string variables to be passed in, and the third parameter must be a string;

The second double-quote \” \”” uses the transfer character, which is the double-quote displayed in BuildConfig, and the internal ${market} is the GooglePlay configuration content ;

Chrome Broswer V98 Can not manually add cookies locally, refresh cannot be retained, and the cookie item is red

Solution for Chrome 91 after SameSite by default cookies were removed, solution for cross-domain POST requests in Chrome that can’t carry cookies

Yesterday after work to start the project, Google Chrome automatically upgraded to version 98, because the previous project is required to manually add a cookie in the local development debugging, now it is impossible to manually add a cookie, and the high version removed SameSite by default cookies, resulting in the previous method can not be used, manually set after the cookie also reported red, as follows:

Now just open Chrome and visit the address chrome://flags/ and search for Partitioned cookies and change the setting to Enabled, restart the browser, manually adding cookies will be retained and will not b