Category Archives: Error

Node.js Error: throw er; // Unhandled ‘error‘ event [How to Solve]

Original console output:

node:events:368
      throw er; // Unhandled 'error' event
      ^

Error [ERR_STREAM_WRITE_AFTER_END]: write after end
    at new NodeError (node:internal/errors:371:5)
    at ServerResponse.end (node:_http_outgoing:846:15)
    at Server.<anonymous> (D:\files\Web_videos\Node\server\app.js:30:13)
    at Server.emit (node:events:390:28)
    at parserOnIncoming (node:_http_server:951:12)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
Emitted 'error' event on ServerResponse instance at:
    at emitErrorNt (node:_http_outgoing:726:9)
    at processTicksAndRejections (node:internal/process/task_queues:84:21) {
  code: 'ERR_STREAM_WRITE_AFTER_END'
}

Error reason:

The port number is occupied.

Solution:  

Modify the port number, or kill the port number and restart the project

How to kill the port number:

1. Enter the CMD command window and write netstat – ano|findstr “8080”

2.taskkill -PID 13512 -F

[Solved] error: ‘xcb_generic_event_t’ was not declared in this scope

code:

bool tray::nativeEventFilter(const QByteArray &eventType, void *message, long *)
{
    qDebug("tray::nativeEventFilter:%s\n", eventType.data());
    if (eventType == "xcb_generic_event_t") {
        xcb_generic_event_t* ev = static_cast<xcb_generic_event_t *>(message);
        // ...
    }
    return false;
}

Tag Page: /home/test/Downloads/tray/tray/tray.cpp:244: error: unknown type name ‘xcb_generic_event_t’
Outcome:
../tray/tray.cpp:244:9: error: ‘xcb_generic_event_t’ was not declared in this scope
xcb_generic_event_t* ev = static_cast<xcb_generic_event_t *>(message);
^~~~~~~~~~~~~~~~~~~
../tray/tray.cpp:244:9: note: suggested alternative: ‘xGenericEvent’
xcb_generic_event_t* ev = static_cast<xcb_generic_event_t *>(message);
^~~~~~~~~~~~~~~~~~~
xGenericEvent
Solution: #include <xcb/xcb.h>
Reference: https://codesearch.isocpp.org/actcd19/main/c/clementine/clementine_1.3.1+git609-g623a53681+dfsg-1/3rdparty/qxt/qxtglobalshortcut_x11.cpp

Error creating bean with name ‘captchaController‘: Unsatisfied dependency expressed through field ‘c

Error creating bean with name 'captchaController': Unsatisfied dependency expressed through field 'configService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sysConfigServiceImpl': Invocation of init method failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is org.springframework.data.redis.connection.PoolException: Could not get a resource from the pool; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to localhost:6379
Check start Redis or not

[Solved] OpenCV Error: AttributeError: module ‘cv2‘ has no attribute ‘data‘

Opencv error: attributeerror: module ‘CV2’ has no attribute ‘data’
the following error will appear when running the face detection code:

face_detector = cv.CascadeClassifier(cv.data.haarcascades + "haarcascade_frontalface_alt2.xml")
eye_detector = cv.CascadeClassifier(cv.data.haarcascades + "haarcascade_eye.xml")
smile_detector = cv.CascadeClassifier(cv.data.haarcascades + "haarcascade_smile.xml")


AttributeError: module 'cv2' has no attribute 'data'

Solution: uninstall your existing opencv Python and install my version of OpenCV

1. Open Anaconda prompt and enter

pip uninstall opencv-python

2. Re input

pip install opencv-python -i http://mirrors.aliyun.com/pypi/simple --trusted-host mirrors.aliyun.com

Note: when uninstalling opencv, select y, and don’t worry about red explosion

[Solved] allure Error: unrecognized arguments: — alluredir — clean alluredir

An integrated environment has been built locally and runs smoothly. When moving to the ECS for construction, allure always reports an error and prompts that the command is wrong. After repeatedly comparing various modules and versions of python, it is found that they are the same and always report this error

ubuntu@VM-16-9-ubuntu:/var/lib/jenkins/workspace/autotest_daily/pytestdemo$ sudo python3 all.py 
ERROR: usage: all.py [options] [file_or_dir] [file_or_dir] [...]
all.py: error: unrecognized arguments: --alluredir --clean-alluredir
  inifile: /var/lib/jenkins/workspace/autotest_daily/pytestdemo/pytest.ini
  rootdir: /var/lib/jenkins/workspace/autotest_daily/pytestdemo

I searched everywhere but couldn’t find it. I thought there was a problem with the version of allure pytest. Compared with the version number, the version number is the same, because the difference between the two servers lies in the difference of source addresses. Is there any difference in the same version? Stuck here for an hour, execute   Sudo PIP3 install — upgrade allure pytest

Installing collected packages: six, allure-python-commons, allure-pytest
Successfully installed allure-pytest-2.9.45 allure-python-commons-2.9.45 six-1.16.0

The problem is that the version of six is different. Finally, we found a different version. The version of six used for local construction is 1.14.0 and the server is 1.16.0

Attempt to downgrade the version of six

sudo pip3 install six==1.14.0

Then continue to build. When pytest is executed normally, the build is OK. I have to say that there are so many holes in Python.

The question is, what does six do?

I searched it again. This thing is used to be compatible with Python 2 and 3 modules. It can be seen from this,

allure   allure-pytest                     2.9.45
allure-python-commons             2.9.45

The first two modules are incompatible with six 1.16.0, so they bring this kind of pit.

[Solved] ERROR: While executing gem … (Gem::FilePermissionError)

Environment: MAC.

When learning rails, follow the official documents. Errors may be reported at this step

 gem install rails

ERROR: While executing gem … (Gem::FilePermissionError)

Even if sudo is used to force the installation, an error will be reported in the next step.

rails new blog

`auth_ data=’: couldn’t set additional authenticated data

Solution:

Installing Ruby under MacOS – 🎄 Adomikao Yu Yongjian

The reason for the error is that the MAC installs ruby in the/usr/bin directory by default. This directory has strict permissions, resulting in code execution failure. The solution is to use RVM to install ruby in the user directory without affecting the system environment.

How to Solve Error: RuntimeError: all tensors must be on devices[0]

Problem description

The code running Zheng Zhedong’s aicity2020 reported an error. After searching, it was found that the problem is that the code running is more than GPU, but the specified code is a single GPU

Solution:

In test2020.py, the code comments in lines 126 and 129 are replaced by the following code

# set gpu ids
# if len(gpu_ids)>0:
# torch.cuda.set_device(gpu_ids[0])
# cudnn.benchmark = True
os.environ['CUDA_VISIBLE_DEVICES'] = str(gpu_ids[0])

jmeter Execute to create Chart Error: An error occurred: Error while processing samples: Mismatch between ……

An error occurred: error while processing samples: mismatch between expected number of columns: 17 and columns in CSV file: 25, check your JMeter. Save. Saveservice. * configuration or check if line 46397 in ‘log. JTL’ is complete

I used many online tutorials, which were not solved and wasted time

The final solution: regenerate the log.jtl file and operate it again

1. Delete the previously generated log.jtl file first

2. Execute the command line to generate log.jtl

D:\apache-jmeter\apache-jmeter-5.4.1> jmeter -n -t pingbi.jmx -l log.jtl

3. Execute the generate chart command line

D:\apache-jmeter\apache-jmeter-5.4.1> jmeter -g log.jtl -o report1

No more errors are reported this time, and the chart is generated successfully

Pod install Error: LoadError [How to Solve]

The boss told me that this is the problem that M1 may encounter, but I’m not M1, and I haven’t updated the system!!! Hahaha, fuck
these two pits are encountered
x 'require': incompatible library version........ (LoadError)

cannot load such file -- 3.0/ffi_c (LoadError)

Screenshot above
when these two pits are encountered. Baidu, there are few online solutions, and the cocoapods are deleted and retried. It’s useless
finally, read the tips carefully!! Let’s enter
gem pristine executable - hooks -- version 1.6.1
but we still can’t
finally, we found it was input 👆 This command has insufficient permissions
you can reuse cocoapods by adding sudo before this command, and pod install is normal. The correct command is as follows
sudo gem pristine executable - hooks -- version 1.6.1

PySpark error: AttributeError: ‘NoneType‘ object has no attribute ‘_jvm‘

Possible reason 1: when you use from pyspark.SQL.Functions import * to pour in the pyspark function, the python built-in function in UDF is replaced by spark function, and you can import it again

Possible reason 2: the user-defined UDF function is not placed in the main function, resulting in an error

error RC2247 : SYMBOL name too long [How to Solve]

An error was reported in compiling usbview today…

error RC2247 : SYMBOL name too long

Therefore, you only need to add it in front of the original usbview.rc


#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#include "prsht.h"
#include "wtypes.h"
#undef APSTUDIO_HIDDEN_SYMBOLS

Then it’s OK
later, use the resource editor provided by vs to change the location and update the resource content again

In this case, the modified full usview.rc content is provided:

#define APSTUDIO_HIDDEN_SYMBOLS
#include "windows.h"
#include "prsht.h"
#include "wtypes.h"
#undef APSTUDIO_HIDDEN_SYMBOLS


#include <windows.h>
#include <commctrl.h>
#include "resource.h"



//#if WINNT
//#include <ntverp.h>
//#else
//#include <version.h>
//#endif


//
//
// VERSION
//
#define VER_FILEDESCRIPTION_STR     "Microsoft\256 Windows(TM) USB Device Viewer"
#define VER_INTERNALNAME_STR        "USBVIEW"
#define VER_ORIGINALFILENAME_STR    "USBVIEW.EXE"
#define VER_LEGALCOPYRIGHT_STR      "Copyright \251 Microsoft Corporation 1996-2008.  All Rights Reserved."

#define VER_FILETYPE     VFT_APP
#define VER_FILESUBTYPE  VFT2_UNKNOWN

//#include <common.ver>


//
//
// ICON
//
IDI_ICON                ICON    DISCARDABLE     "USB.ICO"
IDI_BADICON				ICON	DISCARDABLE		"BANG.ICO"
IDI_COMPUTER			ICON	DISCARDABLE		"MONITOR.ICO"
IDI_HUB					ICON	DISCARDABLE		"HUB.ICO"
IDI_NODEVICE			ICON	DISCARDABLE		"PORT.ICO"

//
//
// Cursor
//
IDC_SPLIT               CURSOR  DISCARDABLE     "SPLIT.CUR"

/
//
// Dialog
//

IDD_MAINDIALOG DIALOGEX 0, 0, 640, 350
STYLE WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU | 
    WS_THICKFRAME
CAPTION "USB View"
MENU IDR_MENU
FONT 8, "MS Shell Dlg"
BEGIN
    CONTROL         "Tree1",IDC_TREE,"SysTreeView32",TVS_HASBUTTONS | 
                    TVS_HASLINES | TVS_LINESATROOT | WS_BORDER | WS_TABSTOP,
                    0,0,400,341,WS_EX_CLIENTEDGE
    EDITTEXT        IDC_EDIT,400,0,240,341,ES_MULTILINE | ES_READONLY | 
                    WS_VSCROLL | WS_HSCROLL
    CONTROL         "Devices Connected: 0",IDC_STATUS,"msctls_statusbar32",
                    SBARS_SIZEGRIP,
                    0,342,640,8
END


IDD_ABOUT DIALOG DISCARDABLE  0, 0, 212, 82
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About USBView"
FONT 8, "MS Shell Dlg"
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,80,62,50,14
    LTEXT           "USB Device Viewer",IDC_STATIC,54,15,64,8
    LTEXT           "Copyright (c) 1996-2008 Microsoft Corporation",
                    IDC_STATIC,54,30,145,8
#ifndef WINNT
    LTEXT           "Version",IDC_STATIC,55,45,24,8
    LTEXT           VER_PRODUCTVERSION_STR,IDC_STATIC,87,45,33,8
#endif
    ICON            IDI_ICON,IDC_STATIC,15,15,21,20
END


/
//
// Menu
//

IDR_MENU MENU DISCARDABLE 
BEGIN
    POPUP "&File"
    BEGIN
        MENUITEM "&Refresh\tF5",                ID_REFRESH
        MENUITEM SEPARATOR
        MENUITEM "E&xit",                       ID_EXIT
    END
    POPUP "&Options"
    BEGIN
        MENUITEM "&Auto Refresh",               ID_AUTO_REFRESH
        MENUITEM "&Config Descriptors",         ID_CONFIG_DESCRIPTORS
    END
    POPUP "&Help"
    BEGIN
        MENUITEM "&About",                      ID_ABOUT
    END
END

//
//
// Accelerator
//

IDACCEL ACCELERATORS DISCARDABLE 
BEGIN
    VK_F5,          ID_REFRESH,             VIRTKEY,NOINVERT
END

Content of resource.H:

/*++
Copyright (c) 1998 Microsoft Corporation, All Rights Reserved.
--*/

#define IDD_MAINDIALOG                  101
#define IDR_MENU                        102
#define IDD_ABOUT                       103
#define IDI_ICON                        104
#define IDC_SPLIT                       105
#define IDACCEL                         106

// added ScottT
#define IDI_BADICON                     107
#define IDI_COMPUTER                    108
#define IDI_HUB                         109
#define IDI_NODEVICE                    110

#define IDC_TREE                        1000
#define IDC_EDIT                        1001
#define IDC_STATUS                      1002
#define ID_EXIT                         40001
#define ID_REFRESH                      40002
#define ID_AUTO_REFRESH                 40003
#define ID_CONFIG_DESCRIPTORS           40004
#define ID_ABOUT                        40005
#define IDC_STATIC                      0xFFFFFFFF


#define VER_PRODUCTVERSION_STR			"ubzh.com"

error: #error PCL requires C++14 or above [Solved]

Running a file with a PCL library reports an error #error PCL requires C + + 14 or above

Solution: find all PCL dependent function packages in the project and change their corresponding cmakelists.txt file

For specific modification methods, see

add_compile_options(-std=c++11)

Add a line of code to this line of code

set(CMAKE_CXX_STANDARD 14)

As shown in the figure