sidekick
sidekick copied to clipboard
SQL error when create LogPoint in some methods.
Describe the bug
Hello,
We are trying out this tool to incorporate it to our company and I was able to create log points in some of my classes throw VSCode, but there are cases that I get the next error:
Sidekick: Error occurred while putting logpoint to class [email protected]/*****/ApplicationPlatformRepositoryImpl.java?ref=0fc9cb298a0fcbe7fdb15d4f1da8088f23b3dcc0 on line 176 from client *****: PreparedStatementCallback; SQL [INSERT INTO LogPoint(id, workspace_id, user_id, file_name, line_no, client, condition_expression, expire_secs, expire_count, file_hash, disabled, expire_timestamp, application_filters, log_expression, stdout_enabled, log_level, webhook_ids, from_api, probe_name, tags) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ]; Data truncation: Data too long for column 'id' at row 1; nested exception is com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Data too long for column 'id' at row 1
The method looks like the next one:
public Mono<ApplicationConfig> getApplicationConfig(final String applicationId) {
return Mono.defer(() -> PlatformResourceIdValidator.validateApplicationId(this.idGenerator, applicationId))
.flatMap(platAppId -> {
final AppWorkloadStrategy strategy = this.appWorkloadStrategyFactory.get(platAppId.getApplicationType());
return strategy.getApplicationScalingConfig(platAppId);
})
.onErrorResume(IllegalArgumentException.class, thr -> {
LOGGER.error(thr.getMessage(), thr);
return Mono.error(new NotFoundException(String.format(APPLICATION_NOT_FOUND, applicationId), thr));
}`)
.subscribeOn(Schedulers.boundedElastic());
}
It happens when I try to create the logpoint inside the flatMap lambda expression.
Expected behavior Log point created successfully.
Please complete the following information
- OS: [Linux Ubuntu]
- Arch: [x64]
- Client [VSCode]
- Runtime: [Java]
Hi there @ismadirolas , seems like an issue while putting points inside inner functions. @serkan-ozal please investigate