Category Archives: Error

EF Core Error: “Format of the initialization string does not conform to specification starting at index 0.”

Problem analysis:

I found this error today during the EF Core database migration, my project just copied and pasted the configuration file, and since then I found that the database configuration file json was the culprit.

I found out that the .json file was not set to “copy to output directory”, so the program could not find the data file at runtime. The following figure shows the correct configuration.

This problem is generally divided into two cases: 1.

1, the database link in the database file is not correctly configured .

2, json configuration file is not correctly set to “copy to output directory”, exactly what I mentioned above.

[Solved] serial port Call Error: Permission denied: ‘/dev/ttyUSB0’

1. Reasons

Generally, it is not the root user and has no permission on the port.

2. Solutions

2.1 temporary

1 sudo chmod 777 /dev/ttyUSB0

Modify the permission to be readable, writable and executable. However, this problem will occur again when this setting is restarted and used next time. You need to reset it again.

2.2 permanent

1 sudo usermod -aG dialout usrname

Usrname: user name.

That is, the user name is added to the dialout user group. After restart, it can be used directly.

Spring Cloud Openfeign Get Request 405 Error [How to Solve]

KUST retrieve service

@Resource
private AuthFeignService authFeignService;

@ApiOperation("Obtain user information")
@GetMapping("/get/user")
public ResponseEntity<UserMsgDTO> getUserName(HttpServletRequest request){
    String token = request.getHeader("token");
    UserMsgDTO userMsg = authFeignService.getUserMsg(token);
    log.info("userMsg -> {}", userMsg);
    return Results.success(userMsg);
}

@FeignClient("kust-auth")
public interface AuthFeignService {
    @GetMapping("/auth/get/user")
    UserMsgDTO getUserMsg(String jwtToken);
}

KUST auth service

@ApiOperation("Get the username information in the token")
@GetMapping("/get/user")
public UserMsgDTO getUserMsg(String jwtToken){
    log.info("jwtToken -> {}", jwtToken);
    return JwtUtils.getUSerNameByJwtToken(jwtToken);
}

The error reported by the KUST retrieve service is as follows:

feign.FeignException$MethodNotAllowed: status 405 reading AuthFeignService#getUserMsg(String)

The error reported by the KUST auth service is as follows:

Resolved [org.springframework.web.HttpRequestMethodNotSupportedException: Request method 'POST' not supported]

Reason: The location of the request parameter is not specified in the feign interface, the parameter “String jwtToken” will be encapsulated in the request body by default, feign will check if the request body is empty when passing the request, if not, the Get request will be converted to Post, and the method in the accepted service kust-auth is Get, so it will naturally report an error 405
Solution is as follows: use @RequestParam(“jwtToken”) to clarify the location of the parameters, note: the string in brackets must be written, or start the error

@FeignClient("kust-auth")
public interface AuthFeignService {
    @GetMapping("/auth/get/user")
    UserMsgDTO getUserMsg(@RequestParam("jwtToken") String jwtToken);
}

Then restart and you can get the data

2022-01-25 11:28:43.577 INFO 16236 --- [nio-9001-exec-9] com. coast. search. api. v1. TokenController: userMsg --gt; UserMsgDTO(id=4, name=LIUXIAOPANG)

.\Objects\BH-F103.axf: Error: L6218E: Undefined symbol RCC_APB2PeriphClkCmd (referred from bsp_led.o).

1. Compilation prompt: \Objects\BH-F103.axf: Error: L6218E: Undefined symbol RCC_APB2PeriphClkCmd (referred from bsp_led.o).

2. Solution:

Check RCC_Apb2periphclkcmd press F12 or right-click to select go to definition of ‘RCC_Apb2periphclkcmd ‘, prompt the following undefined error. This indicates that this function is not defined correctly. The correct definition is “rcc_apb2periphclockcmd”.

3. Summary:

In general, when you encounter this error message, the first thing you think of is that the function is undefined or incorrectly defined. You can’t find the function and reference it.

Reference:

Wrong writing

Correct writing:

error An unexpected error occurred: “https://registry.yarnpkg.com/: self signed certificate in certificate chain”.

Elasticsearch Startup Error: main ERROR Unable to locate appender “rolling_old” for logger config “root”

Foreword: start elasticsearch in the test environment today to report an error. The error information is as follows:

main ERROR Unable to locate appender "rolling_old" for logger config "root"

It was because it was started with root for the first time. After the startup failed, it reported an error when switching users to start, because the file in the log directory belongs to root

Solution:

In the elasticsearch configuration file, find the directory where the logs are stored, change the user and group you belong to. Start it again and it's OK!
chown elk.elk -R /var/log/elasticsearch/

[Solved] SAP HANA STUDIO Error: Creating a new procedure is deprecated in the Modeler perspective.

Error when creating a new procedure in HANA Studio:
Creating a new procedure is deprecated in the Modeler perspective. Use the Repositories or Project Explorer view in Development perspective to create Stored Procedures (.hdbprocedure).

Solutions:
Solution 1: This problem occurs in HANA Studio 2.3+ or above, it is recommended to use HANA Studio 2.3+ or below, which can be developed normally
Solution 2: Use HANA Web IDE (SAP HANA Web-based Development Workbench) for development

[Solved] Redis Connection Error: It was not possible to connect to the redis server(s); to create a disconnected multiplexer

The error you are getting is usually a sign that you have not set abortConnect=false in your connection string. The default value for abortConnect is true, which makes it so that StackExchange.Redis won’t reconnect to the server automatically under some conditions. We strongly recommend that you set abortConnect=false in your connection string so that SE.Redis will auto-reconnect in the background if a network blip occurs.

Netcore :
pack: Microsoft.AspNetCore.DataProtection.StackExchangeRedis
using StackExchange.Redis;

public static void Main(string[] args)
{//Reids
var redis = ConnectionMultiplexer.Connect("localhost,abortConnect=false"); // or "localhost,abortConnect=false,connectTimeout=30000,responseTimeout=30000"
var s= redis.GetStatus();
CreateHostBuilder(args).Build().Run();
}

springboot stomp rabbitmq Error: payload=non-loopback access denied [How to Solve]

Recently, I encountered a problem when deploying springboot stomp rabbitmq. Record the troubleshooting process:

2022-01-29 17:02:15.700 ERROR 172512 --- [ent-scheduler-4] o.s.m.s.s.StompBrokerRelayMessageHandler : Received ERROR {message=[Bad CONNECT], content-type=[text/plain], version=[1.0,1.1,1.2], content-length=[26]} session=_system_ text/plain payload=non-loopback access denied

 

The first problem is to find the answer on stackoverflow:

https://stackoverflow.com/questions/45281024/non-loopback-access-denied-error-while-configuring-spring-websocket-with-rabbitm

 

According to the instructions, a problem was found. The guest user is only allowed to access from localhost. My rabbitmq is deployed on another virtual machine, and the web service is another virtual machine, so this error is revealed.

 

View loopback_Users means that setting it to none allows guest users to access remotely.

Check the location of rabbitmq’s configuration file and search for config files

rabbitmq-diagnostics status

I use version 3.7. There is no config files information in the command. By checking rabbitmq startup log, it is found that:

Config files: none

 

So specify the rabbitmq configuration file (note that the last rabbitmq here refers to the configuration file without .conf)


echo "CONFIG_FILE=/usr/local/software/rabbitmq_software/rabbitmq_server-3.7.16/etc/rabbitmq/rabbitmq" > /etc/rabbitmq/rabbitmq-env.conf

echo "loopback_users = none" > /etc/rabbitmq/rabbitmq.conf

 

Restart rabbitmq

rabbitmqctl stop

rabbitmq-server -detached

 

Check the startup file and confirm that the configuration file is loaded

Our program has also been successfully connected