[Solved] could not open error log file: CreateFile() “logs/error.log“ fail

Use the following command on the window to start nginx and report an error

nginx: [alert] could not open error log file: CreateFile() "logs/error.log" fail
ed (3: The system cannot find the path specified)
2022/04/24 20:57:16 [warn] 2880#1980: the "ssl" directive is deprecated, use the
 "listen ... ssl" directive instead in D:\nginx-1.18.0/conf/proxy-to-http.conf:53
2022/04/24 20:57:16 [emerg] 2880#1980: CreateFile() "D:\nginx-1.18.0/logs/access
.log" failed (3: The system cannot find the path specified)

nginx -c ./conf/nginx.conf
1. First check the location where the current command is executed. If not,
solution:
delete all files under logs and then execute the above command

[Solved] VUE npm install Error: Module build failed: Error: ENOENT: no such file or directory, scandir

The error information is as follows:

Module build failed: Error: ENOENT: no such file or directory, scandir 'D:\renren-fast-vue\node_modules\node-sass\vendor'
    at Object.fs.readdirSync (fs.js:904:18)
    at Object.getInstalledBinaries (D:\renren-fast-vue\node_modules\node-sass\lib\extensions.js:132:13)
    at foundBinariesList (D:\renren-fast-vue\node_modules\node-sass\lib\errors.js:20:15)
    at foundBinaries (D:\renren-fast-vue\node_modules\node-sass\lib\errors.js:15:5)
    at Object.<anonymous> (D:\renren-fast-vue\node_modules\node-sass\lib\index.js:14:35)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (D:\renren-fast-vue\node_modules\sass-loader\lib\loader.js:3:14)
    at Module._compile (module.js:653:30)

The solution is as follows:

Re execute NPM rebuild node-sass

Finally, the solution is started successfully:

[Solved] Error: Incorrect arguments to mysqld_stmt_execute

When mysql2 is used to operate the database in express, the paging query will report an error error incorrect arguments to mysqld_stmt_execute

Question

Error reporting: error: incorrect arguments to mysqld_stmt_execute

// Query notes based on number of notes and number of pages
  async getSomeNote(num, page) {
    const fromNum = (page - 1) * num
    const statement = `SELECT id,note_title,note_describe,note_createtime,note_sort FROM notes_test LIMIT ? ,? ;`
    // There is a problem with the parameters fromNum, num passed in here, they are numeric at this point
    const result = await connections.execute(statement, [fromNum, num])
    console.log(result[0]);
    return result[0]
  }

reason

Statement is a query statement for operating the database and is of string type. The contents of the second parameter of execute will be inserted into the statement. At this time, the number type inserted should be of string type, so an error “wrong parameter” is reported.

Solution:

Change the passed in parameter to string type.

// Query notes based on number of notes and number of pages
  async getSomeNote(num, page) {
    const fromNum = (page - 1) * num
    const statement = `SELECT id,note_title,note_describe,note_createtime,note_sort FROM notes_test LIMIT ? ,? ;`
    // Direct string concatenation, converting number types to character types
    const result = await connections.execute(statement, [fromNum+'', num+''])
    console.log(result[0]);
    return result[0]
  }

[USF-XSim-62] ‘elaborate‘ step failed with errors.[Vivado 12-4473] Detected error while running sim

[USF-XSim-62] ‘elaborate’ step failed with error(s). Please check the Tcl console output . and

[Vivado 12-4473] Detected error while running simulation. Please correct the issue and retry this operation.

The problems are as follows:

Ways to find problems

Method 1: messages in vivado cannot see detailed information, but after the error, the path of the log will be displayed. Open D:/vivado/fortest/fortest.sim/sim_1/behav/xsim/ elaboration.log, we can see error: [vrfc 10-3180] cannot find port ‘extreme_Result ‘on this module, modify the error

method 2: directly see the details in the log window in vivado, find the error, and then modify it

my error is that the port name of the instantiated function file in the simulation file is wrong.

Compare the size of two numbers of 8 bits

module extreme_8bit(
    extreme0,
    extreme1,
    DataSign,
    SubType,
    extreme_Result    
    );
 
input [7:0]          extreme0;//vector operand 1 to participate in the most-valued comparison
input [7:0] extreme1;//vector operand 2 to participate in the most-valued comparison
input DataSign;//0: unsigned; 1: signed
input SubType;//0: find the maximum value max;1: find the minimum value min
output reg [7:0] extreme_Result;//the final result   
reg extreme_c_carry;
wire carry;
wire [7:0] extreme_sum;
wire [7:0] temp_extreme0,temp_extreme1;//find the most value when the unsigned highest bit is the same, the virtual construction of the two numbers 
reg [7:0] add_extreme0,add_extreme1;//enter the adder's operands for subtraction operations

Translated with www.DeepL.com/Translator (free version)
reg  [7:0]          min,max;
assign temp_extreme0={1'b1,extreme0[6:0]};
assign temp_extreme1={1'b0,extreme1[6:0]};    


always @(*)begin
extreme_c_carry = 1'b1;
    if(DataSign==0)begin//0:unsigned
    {add_extreme0,add_extreme1} = {temp_extreme0,~temp_extreme1};
        if(SubType==0)begin//0: find the maximum value max, i.e. unsigned vector with same width integer subsumption max
            if(extreme0[7]! =extreme1[7]) begin // make sure the highest bit of the input data is inconsistent 
                if(extreme0[7]==1) begin //extreme0>extreme1
                    max <= extreme0;
					extreme_Result <= max;
				end 
				else begin //extreme0[7]==0;extreme1[7]==1;extreme0<extreme1
					max <= extreme1;
					extreme_Result <= max;
				end 
            end
            else begin//extreme0[7]==extreme1[7] input data highest bit is the same, remove the highest bit to do the difference
                if(extreme_sum[7]==1)begin//extreme0>extreme1,when subtracting, the highest bit does not happen to be borrowed, the highest bit built 1 is still 1
				    max <= extreme0;
				    extreme_Result <= max;							
				end 
				else begin//extreme_sum[7]==0,extreme0<extreme1,,when subtracted, the highest bit is borrowed and the constructed 1 becomes 0
				    max <= extreme1;
				    extreme_Result <= max;	
				end
            end
        end
        else begin//SubType==1,1:Find the minimum min, i.e., the minimum with unsigned vectors of the same width integer normalization 
            if(extreme0[7]! =extreme1[7]) begin // Determine if the highest bit of the input data is inconsistent 
                if(extreme0[7]==1) begin//extreme0>extreme1 
					min <= extreme1;
					extreme_Result <= min;
				end 
				else begin //extreme0[7]==0;extreme1[7]==1;extreme0<extreme1
                    min <= extreme0;
					extreme_Result <= min;
				end 
            end
            else begin//extreme0[7]==extreme1[7]Input data highest bit is the same, remove the highest bit to do the difference
                if(extreme_sum[7]==1)begin//extreme0>extreme1,when subtracting, the highest bit does not happen to borrow, the highest bit built 1 is still 1
				    min <= extreme1;
					extreme_Result <= min;							
				end 
				else begin//extreme_sum[7]==0,extreme0<extreme1,,when subtracted, the highest bit is borrowed and the constructed 1 becomes 0
				    min <= extreme0;
					extreme_Result <= min;
				end
            end
        end    
    end

    else begin//DataSign==1,1:with symbols
    {add_extreme0,add_extreme1} = {extreme0,~extreme1};
        if(SubType==0)begin//0: find the maximum value max, i.e. the signed vector with the same width integer subsumption max
            if(extreme0[7]! =extreme1[7])begin///heteroscedasticity of two numbers, the highest bit does not match the case to determine who is the largest integer                    
                if(extreme0[7]==1) begin//extreme0 is a negative number
					max <= extreme1;
					extreme_Result <= max;
				end 
				else begin //extreme1 is a negative number
					max <= extreme0;
					extreme_Result <= max;
				end                                          
            end
            else begin//The same number (with the same positive or negative) of two numbers, the highest bit of the same case to determine who is the largest integer
                if(extreme_sum[7]==1)begin//extreme0<extreme1,the result of subtraction is negative
				    max <= extreme1;
				    extreme_Result <= max;							
				end 
				else begin//extreme_sum[7]==0,extreme0>extreme1,the result of subtraction is positive
				    max <= extreme0;
				    extreme_Result <= max;	
				end
            end
        end
        else begin//SubType==1,1:Find the minimum min, i.e., the signed vector with the same width integer normalized to the minimum      
            if(extreme0[7]! =extreme1[7])begin///Determine who is the smallest integer if the two numbers with different signs and the highest bit do not match                    
                if(extreme0[7]==1) begin//extreme0 is a negative number
					min <= extreme0;
					extreme_Result <= min;
				end 
				else begin //extreme1 is negative
					min <= extreme1;
					extreme_Result <= min;
				end                                          
            end
            else begin//Two numbers with the same number (same positive or negative), the highest bit is the same to determine who is the smallest integer  
                if(extreme_sum[7]==1)begin//extreme0<extreme1,the result of subtraction is negative
				    min <= extreme0;
				    extreme_Result <= min;							
				end 
				else begin//extreme_sum[7]==0,extreme0>extreme1,the result of subtraction is positive
				    min <= extreme0;
				    extreme_Result <= min;	
				end
            end        
        end    
    end    
end    
    
RISCV_8BIT_REDADD extreme(
    .o_sum(extreme_sum),
    .o_cout(carry),
    .i_a(add_extreme0),
    .i_b(add_extreme1),
    .i_cin(extreme_c_carry)
);   
                             
endmodule

The multi bit width is divided into 8 bits to compare the size

module extreme_8bit_256( 
    extreme0,
    extreme1,
    DataSign,
    SubType,
    extreme_temp,
    extreme_result256    
    );
parameter M = 16; //VLEN = 256 ; 
parameter N = 8; //SEW = 8 ;  
 
input    [M-1:0]            extreme0;//The number of vector operands participating in the most-valued comparison1
input [M-1:0] extreme1;//vector operand 2 for the most-valued comparison
input [1:0] DataSign;//x0: unsigned; x1: signed
input [2:0] SubType;//0: find the maximum value max;1: find the minimum value min
output [M-1:0] extreme_temp;
output [N-1:0] extreme_result256;//the final result   

extreme_8bit extreme_8bit_inst0(
    .extreme0(extreme0[N-1:0]),
    .extreme1(extreme1[N-1:0]),
    .DataSign(DataSign[0]),
    .SubType(DataSign[0]),
    .extreme_Result(extreme_temp[N-1:0])   
    );   
    
    genvar i;
    generate 
    for(i = 0;i < 1;i = i + 1)begin
    extreme_8bit extreme_8bit_inst(
    .extreme0(extreme_temp[i*N+N-1:i*N]),
    .extreme1(extreme1[(i+1)*N+N-1:(i+1)*N]),
    .DataSign(DataSign[0]),
    .SubType(SubType[0]),
    .extreme_Result(extreme_temp[(i+1)*N+N-1:(i+1)*N])
    );
    
    assign extreme_result256[N-1:0] = extreme_temp[M-1:M-N];
    end
    
endgenerate 

endmodule

Simulation file (the previous file reported an error because when the extreme_8bit_256 module was instantiated, the port extreme_result256 was incorrectly written as extreme_result, and all displays did not find the port extreme_result)

module fortest_tb(    );
parameter M = 16; //VLEN = 256 ; 
parameter N = 8; //SEW = 8 ;  
   
    reg    [M-1:0]         extreme0;
    reg    [M-1:0]         extreme1;
    reg    [1:0]           DataSign;//0:unsigned; 1: signed
    reg [2:0] SubType;//0: find the maximum value max;1: find the minimum value min  
    wire   [M-1:0]         extreme_temp;
    wire   [N-1:0]         extreme_result;   

    extreme_8bit_256 extreme_8bit_256_inst( 
    .extreme0(extreme0),
    .extreme1(extreme1),
    .DataSign(DataSign),
    .SubType(SubType),
    .extreme_temp(extreme_temp),
    .extreme_result256(extreme_result)    
    );

   initial  begin//DataSign;//x0:unsigned; x1: signed  SubType;//xx0:max;  xx1:min
   extreme0 = 16'b0;
   extreme1 = 16'b0;
   DataSign = 2'b00;
   SubType = 3'b000;
   #100
   SubType = 3'b000;
   extreme0 =  16'b1010_0001_0001_0111;
   extreme1 =  16'b0100_0111_1010_0001;
   #100
   SubType = 3'b001;
   extreme0 =  16'b1010_0001_0001_0111;
   extreme1 =  16'b0100_0111_1010_0001;
   #100
   DataSign = 2'b01;
   SubType = 3'b000;
   extreme0 =  16'b1010_0001_0001_0111;
   extreme1 =  16'b0100_0111_1010_0001;
   #100
   SubType = 3'b001;
   extreme0 =  16'b1010_0001_0001_0111;
   extreme1 =  16'b0100_0111_1010_0001;
   end       
endmodule

[Solved] SyntaxError: Cannot use import statement outside a module

SyntaxError: Cannot use import statement outside a module

Problem: When debugging js code with vs code, I get “SyntaxError: Cannot use import statement outside a module”

import express from "express";

const app=express();
app.listen(9527,function(){
    console.log(9527);
})

Solution:

npm init -y
Add type(“type”:”module”,) in package. json

{
  "name": "serve",
  "version": "1.0.0",
  "description": "Server-side interface building for js phase projects",
  "main": "index.js",
   "type":"module",
  "scripts": {
    "node":"node app.js",
    "dev":"nodemon ./app.js"
  },
  "keywords": [
    "shop"
  ],
  "author": "wff",
  "license": "ISC",
  "devDependencies": {
    "express": "^4.17.3",
    "nodemon": "^2.0.15"
  }
}

The terminal runs node index.js or vs Code F5 can be run.

[Solved] gocad2017 Install error: The installation of MSVC_2010_SP1_x64_32bit has failed.

Problem description
After right-clicking on the .exe file and running it as an administrator, a progress bar will appear for extracting the installation file (Extracting), but after the progress bar ends, an error message as shown in the figure below appears: The installation of MSVC_2010_SP1_x64_32bit has failed., the error interface is shown in the figure below Show.
insert image description here
After querying the information, it is found that uninstalling the corresponding Microsoft Visual C++ 2010 x64 Redistributable in the original computer can solve this problem. Please refer to: ENVI installation process and the solution to the error message The installation of MSVC_2010_SP1_x64_32bit has failed.

Solution:
is: look at the product list through the Windows Installer Clean Up tool, uninstall Microsoft Visual C++ 2010 x64 Redistributable – 10.0.4021 and Microsoft Visual C++ 2010 x86 Redistributable – 10.0.4021, the serial numbers behind may be different, but as long as It can correspond to 2010 in MSVC_2010 mentioned in the error. After these two products are uninstalled, run the installation package to continue the normal installation.

[Solved] ERROR RocketmqCommon-Failed to obtain the host name

report an error when building a rocketmq stand-alone environment.

Problem encountered: using command

nohup sh mqnamesrv &

The following error occurred

java. net. UnknownHostException: hadoop03: hadoop03: unknown error
at java. net. InetAddress. getLocalHost(InetAddress.java:1505)
at org. apache. rocketmq. common. BrokerConfig. localHostName(BrokerConfig.java:201)
at org. apache. rocketmq. common. BrokerConfig.& lt; init> (BrokerConfig.java:39)
at org. apache. rocketmq. broker. BrokerStartup. createBrokerController(BrokerStartup.java:101)
at org. apache. rocketmq. broker. BrokerStartup. main(BrokerStartup.java:56)
Caused by: java. net. UnknownHostException: hadoop03: unknown error
at java. net. Inet4AddressImpl. lookupAllHostAddr(Native Method)
at java. net. InetAddress$2. lookupAllHostAddr(InetAddress.java:928)
at java. net. InetAddress. getAddressesFromNameService(InetAddress.java:1323)
at java. net. InetAddress. getLocalHost(InetAddress.java:1500)
… 4 common frames omitted

This is because the IP address corresponding to your host name cannot be found during startup. Just add the above configuration in /etc/hosts

Solution:

Operate according to the following command

Add the mapping marked in red to the file. Note: permission problems may occur during editing, and the root account needs to be switched

:wq! Save exit

Use the JPS command to check the process to see if NamesrvStartup has been started. If it is about closing it

sh mqshutdown namesrv

Start mqnamesrv again

nohup sh mqnamesrv &

Check the log and solve the problem

[Solved] Bat starts springboot project error: ERROR org.springframework.boot.SpringApplication -Application run failed

Project scenario:

use bat to execute java to start the springboot project in a flash


Problem description

the background log displays the following information

2022-04-25 17:35:27.845 [main] ERROR org.springframework.boot.SpringApplication -Application run failed
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: URL [jar:file:/G:/2022/admin/lib3/yy-common-1.1.jar!/com/yy/config/RemoveDruidAdConfig.class]; nested exception is java.lang.IllegalStateException: Could not evaluate condition on com.yy.config.RemoveDruidAdConfig due to org/springframework/boot/bind/RelaxedPropertyResolver not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake)
    at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.scanCandidateComponents(ClassPathScanningCandidateComponentProvider.java:457)
    at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:316)
    at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:276)
    at org.springframework.context.annotation.ComponentScanAnnotationParser.parse(ComponentScanAnnotationParser.java:128)
    at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:296)
    at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:250)
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:207)
    at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:175)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331)
    at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:247)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:311)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:112)
    at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:746)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:564)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:145)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:730)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:412)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:302)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1301)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1290)
    at com.yy.YyApplication.main(YyApplication.java:18)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
    at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
    at org.springframework.boot.loader.PropertiesLauncher.main(PropertiesLauncher.java:467)
Caused by: java.lang.IllegalStateException: Could not evaluate condition on com.yy.config.RemoveDruidAdConfig due to org/springframework/boot/bind/RelaxedPropertyResolver not found. Make sure your own configuration does not rely on that class. This can also happen if you are @ComponentScanning a springframework package (e.g. if you put a @ComponentScan in the default package by mistake)
    at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:55)
    at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108)
    at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:88)
    at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:71)
    at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.isConditionMatch(ClassPathScanningCandidateComponentProvider.java:512)
    at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.isCandidateComponent(ClassPathScanningCandidateComponentProvider.java:495)
    at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.scanCandidateComponents(ClassPathScanningCandidateComponentProvider.java:430)
    ... 28 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/bind/RelaxedPropertyResolver
    at org.springframework.boot.autoconfigure.condition.OnPropertyCondition$Spec.collectProperties(OnPropertyCondition.java:154)
    at org.springframework.boot.autoconfigure.condition.OnPropertyCondition$Spec.access$000(OnPropertyCondition.java:117)
    at org.springframework.boot.autoconfigure.condition.OnPropertyCondition.determineOutcome(OnPropertyCondition.java:99)
    at org.springframework.boot.autoconfigure.condition.OnPropertyCondition.getMatchOutcome(OnPropertyCondition.java:60)
    at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47)
    ... 34 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.boot.bind.RelaxedPropertyResolver
    at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
    at org.springframework.boot.loader.LaunchedURLClassLoader.loadClass(LaunchedURLClassLoader.java:151)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    ... 39 common frames omitted

Cause analysis:

After comparison and detection, it turns out that the referenced lib package is caused by redundancy


Solution:

Delete the package in lib folder, execute Maven install, and copy the jar package in Lib in target to Lib folder again