Author Archives: Robins

How to solve the problem of “unable to open / dev / vmmon: broken pipeline” when running VMware virtual machine?

When using VMware fusion to install virtual machine system on MAC, sometimes it will prompt “can’t open/dev/vmmon: fracture pipeline”, which is caused by the system blocking some plug-ins of virtual machine

resolvent

Open system preferences – & gt【 Security and privacy] – & gt【 General], there will be a prompt that the plug-in will block. Click allow; Or modify the system security settings to any source

Solve the problem that Gabor can’t start itself after the server is restarted

Questions

When the server deployed with Gabor restarts, it may appear that Gabor can’t follow the system to start itself

Solution

Now assume that the location of the installation directory of Gabor is/usr/local/Gabor. After the installation of Gabor, the docker-compose.yml configuration file will be generated in this directory. You can use docker compose to operate this file to control the startup and shutdown of Gabor.

Next, write a system D service that starts from Gabor, named Gabor. Service (placed in the/etc/system/system directory)

[Unit]
Description=harbor
After=docker.service systemd-networkd.service systemd-resolved.service
Requires=docker.service
Documentation=http://github.com/vmware/harbor

[Service]
Type=simple
Restart=on-failure
RestartSec=5
ExecStart=/usr/local/bin/docker-compose -f  /usr/local/harbor/docker-compose.yml up
ExecStop=/usr/local/bin/docker-compose -f  /usr/local/harbor/docker-compose.yml down

[Install]
WantedBy=multi-user.target

After writing, use systemctl enable harbor.service to set the boot time. Then restart the server for testing.

AVD FFmpeg avcodec_ A solution of open2 returning – 1 (operation not permitted)

I’m working on Android hard decoding recently. Various attempts have been made on the compatible implementation of soft decoding and hard decoding. Later, I suddenly found that it was unable to decode normally, and even failed to open codec appeared.

Use RET = avcodec_ Open2 (CTX, codec, nullptr) the return value is – 1, and the error message is “operation not permitted”. It’s a headache for me. For Android development, permissions, alas AVStream* st = pFormatCtx->streams[streamIdx]; codec_context_ = avcodec_alloc_context3(pCodec); if (!codec_context_) { AVLOGE("Failed to allocate the codec context."); return -1; } if (avcodec_parameters_to_context(codec_context_, st->codecpar) < 0) { AVLOGE("Failed to copy codec parameters to decoder context."); return -1; } if (enable_hw_decode_) { if (codec_context_->codec_id == AV_CODEC_ID_H264) { pCodec = avcodec_find_decoder_by_name("h264_mediacodec"); if (pCodec) { avcodec_free_context(&codec_context_); codec_context_ = avcodec_alloc_context3(pCodec); using_hw_decode_ = true; } } } int ret = 0; if ((ret = avcodec_open2(codec_context_, pCodec, nullptr)) < 0) { AVLOGE("Failed to open codec. ret = %d, %s", ret, PAVUtils::get_error_string(ret)); return -1; }

Because it was copied once at first, but later, if hard decoding was used, the coder was selected again. As a result, the newly applied avcodec context failed to copy the operation parameters from stream to context. When I was using_ hw_ decode_ = Add avcodec before true _ parameters_ to_ context(codec_ context_, st-> codecpar); and it will work normally
it's strange why the relevant parameters are not copied, instead of returning invalid_ Par returns no instead_ What about permit?

You set the variable “no_check_targets“ here and it was unused before it went out of scope.

I haven’t compiled a new version of CEF for a long time. Recently, chrome mentioned that there is a 23% performance improvement in version 91 https://blog.chromium.org/2021/05/chrome-is-faster-in-m91.html Is there such a big improvement?So I want to have a try. As a matter of course, I used my own script to compile. As a result, I encountered a “wonderful” problem. Here is a brief record.

When compiling CEF 4472 (chromium 91) with auto git.py, an error is suddenly reported after the script finishes executing CEF patch apply

Generating CEF project files...
Creating D:\google\cef_new\chromium\src\out\Debug_GN_x86 directory.
ERROR at //.gn:65:20: Assignment had no effect.
no_check_targets = [
                   ^
You set the variable "no_check_targets" here and it was unused before it went
out of scope.
Traceback (most recent call last):
  File "D:\google\cef_new\chromium\src\cef\tools\gclient_hook.py", line 146, in <module>
    RunAction(src_dir, cmd)
  File "D:\google\cef_new\chromium\src\cef\tools\gclient_util.py", line 35, in RunAction
    gclient_utils.CheckCallAndFilter(
  File "D:\google\cef_new\depot_tools\gclient_utils.py", line 673, in CheckCallAndFilter
    raise subprocess2.CalledProcessError(
subprocess2.CalledProcessError: Command 'gn gen out\\Debug_GN_x86 --ide=vs2019 --sln=cef --filters=//cef/*' returned non-zero exit status 1 in D:\google\cef_new\chromium\src
Traceback (most recent call last):
  File "D:\google\cef_new\automate-git.py", line 1462, in <module>
    run('%s %s' % (python_exe, tool), cef_src_dir, depot_tools_dir)
  File "D:\google\cef_new\automate-git.py", line 69, in run
    return subprocess.check_call(
  File "C:\Python39\lib\subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['D:\\google\\cef_new\\depot_tools\\python3.bat', 'D:\\google\\cef_new\\chromium\\src\\cef\\tools\\gclient_hook.py']' returned non-zero exit status 1.

No is defined in chromium. Src. GN_ check_ Targets, but not used. At first, I thought it was my own depot_ Tools version is wrong (I have many depots on my machine_ Tools), and then switch the various branches, commit or not. So, it’s better to add some logs in the python script to see what’s going on.

Through the above error prompt, an error is reported when executing GN Gen , and then through reading CEF/tools/gclient_ hook.py、gclient_ Util.py, to Depot_ In this file, the main function looks for the GN executable file in these two locations:

gclient_ paths.GetPrimarySolutionPath()gclient_ paths.GetBuildtoolsPlatformBinaryPath()

I made up these two paths in gn.py. The first result is:

D:\google\cef_new\chromium\src\third_party\gn\gn.exe

Take a look, third_ There is no GN or gn.exe under Party, so we will use the second method to get the path. The second result is:

D:\Electron\electron\src\buildtools\win\gn.exe

Hey, hey, hey?How did you get under electron?So that's the problem.

The next troubleshooting is relatively simple. Check the implementation of getbuildtools platform binarypath (located in depot)_ Gclient in tools folder_ Paths. Py), the original path is controlled by an environment variable chromium_ BUILDTOOLS_ Path (see function getbuildtoolspath ), and then check the windows system environment variables. I really don't know when there is such an environment variable. I can't remember. Was it manually added when I compiled the electron source code a few months ago

up to now, we have finally come to the conclusion that we have deleted chromium_ BUILDTOOLS_ Path, recompile. Under normal circumstances, the GN to be used should be located under - chromium - SRC - buildtools - win \ . All right, call it a day~

Pychar reported an error. Unable to set the python SDK in Python 3.8. This SDK appears to be invalid.

Problem Description:

After switching a new project, the installation of pyGame package fails and prompts that you cannot
install pyGame in Python 3.8 (py)_ xiaoxiaole) (E:\homestead\py_ Xiaoxiaole/venv/scripts/python. Exe) to set up the python SDK
this SDK appears to be invalid.




Solution:

py_ Xiaoxiaole this project has just been deleted. I don’t know why this interpreter is selected by default first set up the Python interpreter

Select all to display
select the above Python SDK. If it is not available, a new one can be added

when there is an available Python SDK

the pyGame package is successfully installed again and the invalid Python SDK is deleted.

Running trust error reporting linker ‘link. Exe’ not found on Windows

Running trust error reporting linker link.exe not found on Windows

Because on the windows platform, the trust compiler needs the vs C + + compiler. The error usually occurs when using rust C main.rs, because visual studio or C + + build tools are not installed on windows

I download visual studio 2017, install the C + + workload, pro test passed!

Official download address:
https://visualstudio.microsoft.com/zh-hans/downloads/

Network error — browser error [How to Solve]

Record it! After half a month of internship, when I changed the bug today (an interface for modifying personal information), it was obviously changed, and the test environment was running smoothly. When I opened the test environment demonstration, I click submit to modify and report an error network error as shown in the following figure

I opened F12 to view the request, and found that the status was CORS error. My first feeling was that there was a cross domain problem, but I should not, Just opened the console and reported an error, as shown in the figure below:

I still feel that it is cross domain, but it should not be cross domain ~
finally, I found that the top left corner of the browser is as shown in the figure

remember that the company’s domain name has a certificate, is it because there is no s, so I changed the address bar HTTP to HTTPS, The problem is solved ~
then the cross domain reason should be that http//: test.xxx.com visited the interface of HTTPS: test.xxx.com, while the domain name allowed to cross domain in the background is http//: test.xxx.com https://test.xxx.com , which leads to cross domain ~
lack of talent and learning, misunderstanding and mistakes, please give us some advice in the comments area~

Cannot call sendRedirect() after the response has been committed

Cannot call sendredirect() after the response has been committed exception

For the HTTP response, if it has been submitted (redirection, request forwarding, release in the filter), you can’t perform any operation on the response, such as modifying it or submitting it again.

For the submitted response, the method will not end (different from return), it will continue to execute, so if the code that you continue to execute after submitting will still run, the submit response will also cause this error.

For example:

    1. the following code will report an error because it released and submitted the response, and now it operates the response, because the filter release does not return the method, and the method is still executed downward </ OL> instead

        HttpServletRequest httpRequest = (HttpServletRequest) request;
        HttpServletResponse httpResponse = (HttpServletResponse) response;
        boolean boo = "Your judgment conditions";
        if (boo) {
            log.info("enter chain");
            chain.doFilter(request, response);
            //return;
        }
        //This is where the error will be reported because the response was submitted in the above release and now the resposne is being operated
        httpResponse.sendRedirect(TOLOGINURL);

2. The following code will report an error because it is submitted again after redirection, because the redirection will continue


httpResponse.sendRedirect(TOLOGINURL);
//This will report an error because it was committed (redirected) and then committed again
httpResponse.sendRedirect(TOLOGINURL);

The solution is to return after submitting</ Code>, or the check logic will not enter the submit again.

[Solved] java.lang.IllegalStateException: Cannot call sendRedirect() after the response has been committed

Project scenario:

Spring boot project, user-defined filter, intercept requests and process business.


Problem Description:

When you start the project access interface, you call resp.sendRedirect () in the custom filter.


Cause analysis:

After the response has been submitted, the sendredirect() method cannot be called.

In fact, chain. Dofilter (req, resp) is executed; Cannot use sendredirect() of resp object after

So looking at the code, we find that:

...

  HttpServletRequest httpRequest = (HttpServletRequest) request;
  HttpServletResponse httpResponse = (HttpServletResponse) response;
  ....
  boolean flag = getStatus();
  if (flag) {
      ....
      chain.doFilter(request, response);
  }
  httpResponse.sendRedirect(“xxxx”);
...

if the judged flag is true, chain.dofilter (request, response) will be executed, and httpresponse.sendredirect (“XXXX”) </ font> will be executed after execution


Solution:

After chain. Dofilter (request, response), add return to end the current method.

...

  HttpServletRequest httpRequest = (HttpServletRequest) request;
  HttpServletResponse httpResponse = (HttpServletResponse) response;
  ....
  boolean flag = getStatus();
  if (flag) {
      ....
      chain.doFilter(request, response);
      return;
  }
  httpResponse.sendRedirect(“xxxx”);
...