Category Archives: Error

How to Solve vtk error (vtkInteractorStyleSwitchBase & vtkWin32OpenGLRenderWin Error)

python3. 7.10
vtk9. one

Error 1

Core code

from vtkmodules.qt.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor

self.lb = QVTKRenderWindowInteractor(self)
self.gridLayout_G.addWidget(self.lb, 0, 0, 0, 0)
self.lb.GetRenderWindow().GetInteractor().Start()

Complete code

#!/usr/bin/env python
# _*_ coding:utf-8 _*_
import sys

from PyQt5 import QtWidgets
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QApplication

from vtkmodules.qt.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor

from SliceViewPanel import Ui_Widget


class SliceViewPanelWidget(QtWidgets.QWidget, Ui_Widget):
    four_views_path = 'resources/dl_fourviews.png'

    def __init__(self, parent=None, plane_name='', icon_path=''):
        super(SliceViewPanelWidget, self).__init__(parent)
        self.setupUi(self)
        self.lb = None
        self.plane_name = plane_name
        self.icon_path = icon_path
        print(plane_name)
        self.var_init()

    def set_tool_icon(self, four_views):
        """
        Set the label of the Show/Hide button
        :param four_views: Hide True/Show False
        """
        if four_views:
            self.toolButton.setIcon(QIcon(SliceViewPanelWidget.four_views_path))
        else:
            self.toolButton.setIcon(QIcon(self.icon_path))

    def var_init(self):
        """
        Clear variables
        """
        self.lb = QVTKRenderWindowInteractor(self)
        self.gridLayout_G.addWidget(self.lb, 0, 0, 0, 0)
        self.G.setTitle(self.plane_name)
        self.set_tool_icon(False)
        self.lb.GetRenderWindow().GetInteractor().Start()

    def close(self):
        """
        Close
        """
        print('close {}'.format(self.plane_name))
        if self.lb is not None:
            self.lb.Finalize()

    def closeEvent(self, event):
        """
        Close event
        :param event: event
        """
        self.close()


if __name__ == '__main__':
    app = QApplication(sys.argv)
    my_widget = SliceViewPanelWidget(parent=None, plane_name='Transverse', icon_path='resources/dl_axial.png')
    my_widget.show()
    sys.exit(app.exec_())

report errors

Warning: In C:\glr\builds\vtk\vtk-ci-ext\0\Rendering\Core\vtkInteractorStyleSwitchBase.cxx, line 37
vtkInteractorStyleSwitchBase (0000021133F56FF0): Warning: Link to vtkInteractionStyle for default style selection.

Solution:

Method 1

These two sentences
and those two sentences are annotated in order not to make pycharm think these two sentences are useless

# noinspection PyUnresolvedReferences
import vtkmodules.vtkInteractionStyle
# noinspection PyUnresolvedReferences
import vtkmodules.vtkRenderingOpenGL2

Method 2

In fact, the essence is the same as method 1

# noinspection PyUnresolvedReferences
import vtkmodules.all as vtk

Complete code

#!/usr/bin/env python
# _*_ coding:utf-8 _*_
import sys

from PyQt5 import QtWidgets
from PyQt5.QtGui import QIcon
from PyQt5.QtWidgets import QApplication
# noinspection PyUnresolvedReferences
import vtkmodules.all as vtk
from vtkmodules.qt.QVTKRenderWindowInteractor import QVTKRenderWindowInteractor

from SliceViewPanel import Ui_Widget


class SliceViewPanelWidget(QtWidgets.QWidget, Ui_Widget):
    four_views_path = 'resources/dl_fourviews.png'

    def __init__(self, parent=None, plane_name='', icon_path=''):
        super(SliceViewPanelWidget, self).__init__(parent)
        self.setupUi(self)
        self.lb = None
        self.plane_name = plane_name
        self.icon_path = icon_path
        print(plane_name)
        self.var_init()

    def set_tool_icon(self, four_views):
        """
        Set the label of the Show/Hide button
        :param four_views: Hide True/Show False
        """
        if four_views:
            self.toolButton.setIcon(QIcon(SliceViewPanelWidget.four_views_path))
        else:
            self.toolButton.setIcon(QIcon(self.icon_path))

    def var_init(self):
        """
        Clear variables
        """
        self.lb = QVTKRenderWindowInteractor(self)
        self.gridLayout_G.addWidget(self.lb, 0, 0, 0, 0)
        self.G.setTitle(self.plane_name)
        self.set_tool_icon(False)
        self.lb.GetRenderWindow().GetInteractor().Start()

    def close(self):
        """
        Colose
        """
        print('close {}'.format(self.plane_name))
        if self.lb is not None:
            self.lb.Finalize()

    def closeEvent(self, event):
        """
        Close event
        :param event: event
        """
        self.close()


if __name__ == '__main__':
    app = QApplication(sys.argv)
    my_widget = SliceViewPanelWidget(parent=None, plane_name='Transverse', icon_path='resources/dl_axial.png')
    my_widget.show()
    sys.exit(app.exec_())

Error report 2

vtkWin32OpenGLRenderWin:267    ERR| vtkWin32OpenGLRenderWindow (00000169B85B09C0): wglMakeCurrent failed in MakeCurrent(), error:
vtkWin32OpenGLRenderWin:102    ERR| vtkWin32OpenGLRenderWindow (00000169B85B09C0): wglMakeCurrent failed in Clean()

Solution:

First point
this code is called repeatedly in my code
that is, repeated initialization

    def var_init(self):
        self.lb = QVTKRenderWindowInteractor(self)
        self.gridLayout_G.addWidget(self.lb, 0, 0, 1, 1)
        self.lb.GetRenderWindow().GetInteractor().Start()

In fact, just initialize it once

The second point
You should call finalize at the end of the QVTKRenderWindowInteractor program

# self.lb = QVTKRenderWindowInteractor(self)
self.lb.Finalize()

buildroot SIGSTKSZ Error: make[5]: *** [Makefile:1915: c-stack.o] Error 1

Project scenario:

Error when compiling builderoot:

Problem description:

Error when compiling builderoot:

PATH="/home/dlxy/sambashare/LicheepiNano/buildroot-2018.02.5/output/host/bin:/home/dlxy/sambashare/LicheepiNano/buildroot-2018.02.5/output/host/sbin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin:/opt/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi/bin" PKG_CONFIG="/home/dlxy/sambashare/LicheepiNano/buildroot-2018.02.5/output/host/bin/pkg-config" PKG_CONFIG_SYSROOT_DIR="/" PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_LIBDIR="/home/dlxy/sambashare/LicheepiNano/buildroot-2018.02.5/output/host/lib/pkgconfig:/home/dlxy/sambashare/LicheepiNano/buildroot-2018.02.5/output/host/share/pkgconfig"  /usr/bin/make -j2  -C /home/dlxy/sambashare/LicheepiNano/buildroot-2018.02.5/output/build/host-m4-1.4.18/

/usr/bin/make  all-recursive

Making all in .

make[4]: Nothing to be done for 'all-am'.

Making all in examples

make[4]: Nothing to be done for 'all'.

Making all in lib

/usr/bin/make  all-am

  CC       c-stack.o

  CC       clean-temp.o

In file included from /usr/include/signal.h:328,

                 from ./signal.h:52,

                 from c-stack.c:49:

c-stack.c:55:26: error: missing binary operator before token "("

   55 | #elif HAVE_LIBSIGSEGV && SIGSTKSZ < 16384

      |                          ^~~~~~~~

make[5]: *** [Makefile:1915: c-stack.o] Error 1





Solution:

Locate c-stack.c file in the builderoot folder
line 55:

comment out the following contents, and the results are as follows:

[Solved] G2o pointer error: error: no matching function for call to ‘g2o::BlockSolver

G2o pointer error

1. Problem description I

error: no matching function for call to ‘g2o::BlockSolver<g2o::BlockSolverTraits<-1, -1> >::BlockSolver(SlamLinearSolver*&)

And prompt

std::unique_ptr

The reason for the pointer may be a repeated reference.

G2oSolver::G2oSolver()
{
  // Step 1: Create a linear solver LinearSolver
  SlamLinearSolver *linearSolver = new SlamLinearSolver();
  linearSolver->setBlockOrdering(false);
  // Step 2: Create the BlockSolver and initialize it with the linear solver defined above
  SlamBlockSolver *blockSolver = new SlamBlockSolver(linearSolver);
  // Step 3: Create the total solver solver and select one from GN, LM, DogLeg and initialize it with the block solver BlockSolver defined above
  g2o::OptimizationAlgorithmLevenberg *solver = new g2o::OptimizationAlgorithmLevenberg(blockSolver);
  // Step 4: Create the sparse optimizer (SparseOptimizer)
  mOptimizer.setAlgorithm(solver);
}

Modified code:

G2oSolver::G2oSolver()
{
  // Step 1: Create a linear solver LinearSolver
  SlamLinearSolver *linearSolver = new SlamLinearSolver();
  linearSolver->setBlockOrdering(false);
  // Step 2: Create the BlockSolver and initialize it with the linear solver defined above
  SlamBlockSolver *blockSolver=new SlamBlockSolver(std::unique_ptr<SlamLinearSolver>(linearSolver));
  // Step 3: Create the total solver solver and select one from GN, LM, DogLeg and initialize it with the above block solver BlockSolver
  g2o::OptimizationAlgorithmLevenberg *solver = new g2o::OptimizationAlgorithmLevenberg(std::unique_ptr<SlamBlockSolver>( blockSolver));
  // Step 4: Create the Sparse Optimizer (SparseOptimizer)
  mOptimizer.setAlgorithm(solver);
}

2. Problem description II

fatal error: cs.h: No such file or directory

the error is in /usr/local/include/g2o/solvers/csparse/csparse_extension.h:

#include <cs.h>

Install
CSparse

sudo apt-get install libsuitesparse-dev

Find the header file

/usr/include/suitesparse/cs.h

add the header files in CMakeLists.txt:

include_directories("/usr/include/suitesparse") 
target_link_libraries(${PROJECT_NAME}_karto_slam_node
  ${catkin_LIBRARIES}
  ${Boost_LIBRARIES}
  sba
  ${CERES_LIBRARIES}
  gtsam

  ${G2O_LIBRARIES}
  ${SUITESPARSE_LIBRARIES}
)

Go build package error: TARGET_OS_MAC & IOMasterPort

Go build packaging Error:

TARGET_OS_MAC & IOMasterPort


#github.com/shirou/gopsutil/cpu
../../../../go/pkg/mod/github.com/shirou/[email protected]+incompatible/cpu/cpu_darwin_cgo.go:13:5: 
warning: 'TARGET_OS_MAC' is not defined, evaluates to 0 [-Wundef-prefix=TARGET_OS_]



#github.com/shirou/gopsutil/disk
iostat_darwin.c:28:2: 
warning: 'IOMasterPort' is deprecated: first deprecated in macOS 12.0 [-Wdeprecated-declarations]

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:132:1: 
note: 'IOMasterPort' has been explicitly marked deprecated here

I don’t know the cause of the problem at present. It may be caused by the upgrade of the MAC system

My version is MacOS Monterey 12.3

Solution (not necessarily effective)

Modify CGO_ENABLED,default is CGO_ENABLED="1"

go env -w CGO_ENABLED="0"

How to Solve Xcode M1 simulator Error

Error reported by Xcode M1 simulator

Operation error:

1.building for iOS Simulator, but linking in object file built for iOS, for architecture arm64
2.The linked framework ‘Pods.framework’ is missing one or more architectures required by this target: arm64

Solution:
1 Build settings change:

2 Podfile add:

 post_install do |installer|
   installer.pods_project.build_configurations.each do |config|
     config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
   end
 end

3.xcode clean;
4. pod install

Pod installation errors:

sudo arch -x86_64 gem install ffi
gem install ffi --version 1.13.1 --user-install
arch -x86_64 pod install

[Solved] flitter Name Route Error: Could not find a generator for route RouteSettings(“XXX”, null) in the _WidgetsAppState

A bug encountered in the configuration of the flutter route: an error is reported: Could not find a generator for route RouteSettings(“XXX”, null) in the _WidgetsAppState.

reason:

Use “/” as the root path when using named routes in the project,
// configure routes
final routes={
‘/’:(context)=>Tabs(),
‘/appBarDemo’:(context)=>AppBarDemoPage(),
‘/tabBarController’:(context)=>TabBarControllerPage()
};

Use home:Tabs() in the root file,

 

Solution:

Change home: tabs() to
onGenerateRoute: onGenerateRoute,
initialRoute: ‘/’,

[Solved] dockerfile Build Image Error: Error: Failed to download metadata for repo ‘appstream’…

Error content

Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

Solution:

Modify the dockerfile file and add the following red box content
Finally, the docker image is successfully built
It is estimated that there is a problem with some Yum sources of centos8

Reference
https://stackoverflow.com/questions/70963985/error-failed-to-download-metadata-for-repo-appstream-cannot-prepare-internal

How to Solve Starrocks Various Error

Question 1:

Question:

{"status":"FAILED","msg":"There is no 100-continue header"}

reason:

This prompt appears because the CSV file is empty. In fact, it will not be affected.

Solution:

Add a request header to the command

-H "expect:100-continue"

curl –location-trusted -u root: -H “column_separator:|” -H “columns:__op=‘upsert’” -H “expect:100-continue” -T /home/zw/insert_sr_file/ip_basic.csv http://127.0.0.1:8030/api/zw/ip_basic/_stream_load

 

Question 2:

Question

There is data in the CSV file, but the error is still reported
CSV data

reason:

This error occurs because the corresponding data in the file does not correspond to the table field

Solution:

Receipt can be performed according to the fields specified in columns
usage:

-H "columns:pid,ip_val,area_id......"

Syntax use case:

curl --location-trusted -u root: \
-H "column_separator:|" \
-H "columns:pid,ip_val,area_id,udate,ftime,utime,ip,bip,cip,oui,mac,cname,user,depart,comp,place,os,os_sub,os_version,host_name,detail,m_type,m_sub_type,bip_val,cip_val,is_asset,is_controlled,source,domain,network_type,insert_unixtime,country_code,__op='upsert'" \
-T /home/zw/insert_sr_file/ip_basic.csv \
http://172.16.130.184:8030/api/zw/ip_basic/_stream_load

 

Question 3

problem

all partitions have no load data

reason

Caused by an empty file

solve

Don’t take it seriously. It won’t prompt if it’s not an empty file. Not affect

Wildfly (JBoss) startup error: ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation (“add”) failed

Error content:

15:07:50,724 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "MESwell.ear")]) 
- failure description: "WFLYCTL0212: Duplicate resource [(\"deployment\" => \"MESwell.ear\")]"

15:07:50,728 FATAL [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0056: Server boot has failed in an unrecoverable manner; exiting. See previous messages for details.

 

Error reporting scenario:

This error occurs when I start it normally for the first time, and then turn it off. When I start it for the second time, it will fail to start. Many answers were searched on the Internet, but they failed. Later, I found this answer:

[wfcore-495] wfly won’t startup due to “wflyctl0212: duplicate resource [(\” deployment \ “= & gt; \” XXX. War \ “)] – red hat issue tracker

Through this answer, I know that it must be related to the nonstandard start-up operation of my second time. The nonstandard start-up led to the existence of the cache started last time. Then I searched wildfly how to clean up the cache.

 

Here is the Solution:

1. Find the package you put under \wildfly-10.1.0.Final\standalone\deployments\, check its startup status, and delete the files generated after the startup failure. (It seems to be fine without cleaning up)

2. Delete all files under \wildfly-10.1.0.Final\standalone\data

3、Go to \wildfly-10.1.0.Final\standalone\configuration and find your standalone.xml

Search for deployment, find a string of tags like the following generated, delete!

4. After executing the appeal operation, check whether the above three steps are not clear and clean

5. Restart your wildfly (JBoss)

[Solved] adb Error: error: no devices/emulators found error: cannot connect to daemon

Scenario: Because the version using Jenkins file address phone can not download apk package, so can only be installed through adb to test the package. The phone model installed is Android: oopa57 Android system version 6.0.1.

The first thing is to use win + r to punch the Windows system command window, enter adb

Successful installation is shown in the figure above.

Confirm that the ADB installation is successful and enter ADB devices

The phone model is successfully identified as shown in the figure above.

Then enter

For example: adb install E:\***-***-2.0.0.1.apk

At this time, there will be an error prompt: the device cannot be found and cannot be installed

1: Check whether the developer mode of the mobile phone is turned on. Different mobile phones are turned on in different ways. Just Google

2: After opening, enter the loading command again

USB debugging is not turned on. As shown in step 1, the USB debugging at the bottom of the figure. Enter again after start

Note: during installation, the mobile phone will pop up to ask whether debugging is allowed, and click OK.

Then confirm that the installation is completed.

Note: Another case is that the data line is in poor contact with the USB interface. It is available when entering a command, but the next command fails. Pay attention to troubleshooting.

[Solved] SpringMVC Error: war exploded: Error during artifact deployment. See server log for details.

When starting tomcat, the following error is reported:

war exploded: Error during artifact deployment. See server log for details.

Solution:

Step 1: See someone online said that generally under WEB-INF, there should be applicationContext.xml file, even if not, the context should be specified in web.xml, so add the following code in web.xml:

Step 2: Be sure to write the bean in applicationContext.xml. (This is my own careless mistake, only used to remind everyone)

In short

This error has plagued me for a long time, I checked a lot of methods on the Internet but they do not apply, so this article is only used to help you troubleshoot, but also according to their own actual procedures to determine.