Cannot attach a screenshot [v5]
Denysss opened this issue · 11 comments
Describe the bug
My tests send the attachments to ReportPortal. RP shows attachment log messages but does not show the attached files.
// 1
try {
ReportPortalMessage message = new ReportPortalMessage(file, "attached screenshot via logging ReportPortalMessage");
log.info(message);
} catch (IOException e) {
log.warn("cannot send screenshot to ReportPortal as a ReportPortalMessage");
}
// 2
boolean emitLogResult = ReportPortal.emitLog("attached screenshot - ReportPortal.emitLog", "INFO", Calendar.getInstance().getTime(), file);
log.info("screenshot via ReportPortal.emitLog: {}", emitLogResult);
// 3
boolean result = ReportPortal.emitLaunchLog("attached screenshot - ReportPortal.emitLaunchLog", "INFO", Calendar.getInstance().getTime(), file);
log.info("screenshot via ReportPortal.emitLaunchLog: {}", result);
// 4
Launch.currentLaunch().getStepReporter().sendStep(ItemStatus.FAILED, "attached screenshot - sendStep", file);
To Reproduce
https://github.com/Denysss/rp-screenshot-bug
mvn clean test
Expected behavior
I can see the files (png and html files) in ReportPortal that were sent by my tests
Desktop (please complete the following information):
- OS: Windows 10 1909 (18363.900)
- Browser: Chrome 83
- Java: openjdk 11 2018-09-25
- RP logger-java-log4j: 5.0.0-RC-2
- RP agent-java-junit5: 5.0.0-BETA-11
- RP Docker compose: https://github.com/Denysss/rp-screenshot-bug/blob/master/docker-compose.yml
- junit5: 5.6.2
- log4j2: 2.13.3
Anything in logs?
@Denysss what was your RP server version?
(Can be found under login form)
RP server version is 5.2.0
RP current version:
API Service: 5.2.1;
Index Service: 5.0.7;
Authorization Service: 5.2.1;
Service UI: 5.2.0;
I've redeployed the RP server with the latest version but the issue still exists.
API Service: 5.2.2;
Index Service: 5.0.7;
Authorization Service: 5.2.1;
Service UI: 5.2.2;
@Denysss no any issues on our side with you example.
Could you please see logs of service-api
container in docker at the moment of logging?
I have ErrorResponseException and ReportPortalException in the logs on the service-api:
2020-06-12 07:44:17.950 ERROR 6 --- [logs-task-exec2] c.e.t.r.f.d.minio.MinioDataStore : Unable to save file '3/2020-6/978fca65-e557-4abd-866f-81aca3a33996/3bd910c9-94bc-4708-9b95-0b6f6c0a0431-binary_part.png'
io.minio.errors.ErrorResponseException: We encountered an internal error, please try again.
at io.minio.MinioClient.executeReq(MinioClient.java:1220)
at io.minio.MinioClient.execute(MinioClient.java:1082)
at io.minio.MinioClient.executePut(MinioClient.java:1446)
at io.minio.MinioClient.executePut(MinioClient.java:1468)
at io.minio.MinioClient.putObject(MinioClient.java:4747)
at io.minio.MinioClient.putObject(MinioClient.java:4800)
at io.minio.MinioClient.putObject(MinioClient.java:4714)
at io.minio.MinioClient.putObject(MinioClient.java:4332)
at com.epam.ta.reportportal.filesystem.distributed.minio.MinioDataStore.save(MinioDataStore.java:71)
at com.epam.ta.reportportal.binary.impl.CommonDataStoreService.save(CommonDataStoreService.java:44)
at com.epam.ta.reportportal.binary.impl.AttachmentBinaryDataServiceImpl.saveAttachment(AttachmentBinaryDataServiceImpl.java:94)
at com.epam.ta.reportportal.binary.impl.AttachmentBinaryDataServiceImpl.saveFileAndAttachToLog(AttachmentBinaryDataServiceImpl.java:111)
at com.epam.ta.reportportal.core.log.impl.SaveLogBinaryDataTask.run(SaveLogBinaryDataTask.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
2020-06-12 07:44:17.952 ERROR 6 --- [logs-task-exec1] c.e.t.r.f.d.minio.MinioDataStore : Unable to save file '3/2020-6/978fca65-e557-4abd-866f-81aca3a33996/9da59ac3-6ac4-4b23-b233-427a88f79150-binary_part.html'
io.minio.errors.ErrorResponseException: We encountered an internal error, please try again.
at io.minio.MinioClient.executeReq(MinioClient.java:1220)
at io.minio.MinioClient.execute(MinioClient.java:1082)
at io.minio.MinioClient.executePut(MinioClient.java:1446)
at io.minio.MinioClient.executePut(MinioClient.java:1468)
at io.minio.MinioClient.putObject(MinioClient.java:4747)
at io.minio.MinioClient.putObject(MinioClient.java:4800)
at io.minio.MinioClient.putObject(MinioClient.java:4714)
at io.minio.MinioClient.putObject(MinioClient.java:4332)
at com.epam.ta.reportportal.filesystem.distributed.minio.MinioDataStore.save(MinioDataStore.java:71)
at com.epam.ta.reportportal.binary.impl.CommonDataStoreService.save(CommonDataStoreService.java:44)
at com.epam.ta.reportportal.binary.impl.AttachmentBinaryDataServiceImpl.saveAttachment(AttachmentBinaryDataServiceImpl.java:94)
at com.epam.ta.reportportal.binary.impl.AttachmentBinaryDataServiceImpl.saveFileAndAttachToLog(AttachmentBinaryDataServiceImpl.java:111)
at com.epam.ta.reportportal.core.log.impl.SaveLogBinaryDataTask.run(SaveLogBinaryDataTask.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Exception in thread "logs-task-exec2" com.epam.ta.reportportal.exception.ReportPortalException: Incorrect Request. Unable to save file
at com.epam.ta.reportportal.filesystem.distributed.minio.MinioDataStore.save(MinioDataStore.java:75)
at com.epam.ta.reportportal.binary.impl.CommonDataStoreService.save(CommonDataStoreService.java:44)
at com.epam.ta.reportportal.binary.impl.AttachmentBinaryDataServiceImpl.saveAttachment(AttachmentBinaryDataServiceImpl.java:94)
at com.epam.ta.reportportal.binary.impl.AttachmentBinaryDataServiceImpl.saveFileAndAttachToLog(AttachmentBinaryDataServiceImpl.java:111)
at com.epam.ta.reportportal.core.log.impl.SaveLogBinaryDataTask.run(SaveLogBinaryDataTask.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Exception in thread "logs-task-exec1" com.epam.ta.reportportal.exception.ReportPortalException: Incorrect Request. Unable to save file
at com.epam.ta.reportportal.filesystem.distributed.minio.MinioDataStore.save(MinioDataStore.java:75)
at com.epam.ta.reportportal.binary.impl.CommonDataStoreService.save(CommonDataStoreService.java:44)
at com.epam.ta.reportportal.binary.impl.AttachmentBinaryDataServiceImpl.saveAttachment(AttachmentBinaryDataServiceImpl.java:94)
at com.epam.ta.reportportal.binary.impl.AttachmentBinaryDataServiceImpl.saveFileAndAttachToLog(AttachmentBinaryDataServiceImpl.java:111)
at com.epam.ta.reportportal.core.log.impl.SaveLogBinaryDataTask.run(SaveLogBinaryDataTask.java:49)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
2020-06-12 07:44:18.072 INFO 6 --- [ Thread-7] c.e.t.r.c.a.auto.impl.LogIndexerService : Start indexing for 1 launches
2020-06-12 07:44:18.102 INFO 6 --- [ Thread-7] o.s.a.r.c.CachingConnectionFactory : Attempting to connect to: rabbitmq:5672
2020-06-12 07:44:18.107 INFO 6 --- [ Thread-7] o.s.a.r.c.CachingConnectionFactory : Created new connection: analyzerConnectionFactory#512d6e60:0/SimpleConnection@1a05041d [delegate=amqp://rabbitmq@172.18.0.11:5672/analyzer, localPort= 41670]
2020-06-12 07:44:18.111 INFO 6 --- [ Thread-7] o.s.s.c.ThreadPoolTaskScheduler : Initializing ExecutorService
2020-06-12 07:44:18.114 INFO 6 --- [ Thread-7] .l.DirectReplyToMessageListenerContainer : Container initialized for queues: [amq.rabbitmq.reply-to]
2020-06-12 07:44:18.121 INFO 6 --- [ Thread-7] .l.DirectReplyToMessageListenerContainer : SimpleConsumer [queue=amq.rabbitmq.reply-to, consumerTag=amq.ctag-OxG3-cNSszG6nn3jv7fGuw identity=542e36bd] started
2020-06-12 07:44:19.390 INFO 6 --- [ Thread-7] c.e.t.r.c.a.auto.impl.LogIndexerService : Indexed 5 logs
@Denysss your MinIO service is out of service.
it can't store files on disk.
check available storage, and permissions on folders
@DzmitryHumianiuk you are right, the MinIO cannot store the files. So it's my local issue. I deployed the RP on a CentOS server and it works fine.
@DzmitryHumianiuk @HardNorth thank you for your help and attention
FYI:
The logs from the minio (RELEASE.2020-05-01T22-19-14Z) on the Windows 10:
...
API: SYSTEM()
Time: 08:41:31 UTC 06/12/2020
DeploymentID: 09a030fd-1772-4761-860b-8fc94753bb87
Error: Unexpected error, please report this issue at https://github.com/minio/minio/issues
6: github.com/minio/minio@/cmd/fs-v1-helpers.go:333:cmd.fsCreateFile()
5: github.com/minio/minio@/cmd/fs-v1.go:997:cmd.(*FSObjects).putObject()
4: github.com/minio/minio@/cmd/fs-v1.go:911:cmd.(*FSObjects).PutObject()
3: github.com/minio/minio@/cmd/data-usage-cache.go:358:cmd.(*dataUsageCache).save()
2: github.com/minio/minio@/cmd/fs-v1.go:278:cmd.(*FSObjects).CrawlAndGetDataUsage()
1: github.com/minio/minio@/cmd/data-usage.go:88:cmd.runDataUsageInfo()
API: SYSTEM()
Time: 08:41:31 UTC 06/12/2020
DeploymentID: 09a030fd-1772-4761-860b-8fc94753bb87
Error: Unexpected error, please report this issue at https://github.com/minio/minio/issues
2: github.com/minio/minio@/cmd/fs-v1.go:278:cmd.(*FSObjects).CrawlAndGetDataUsage()
1: github.com/minio/minio@/cmd/data-usage.go:88:cmd.runDataUsageInfo()
API: SYSTEM()
Time: 08:41:31 UTC 06/12/2020
DeploymentID: 09a030fd-1772-4761-860b-8fc94753bb87
Error: Unexpected error, please report this issue at https://github.com/minio/minio/issues
4: github.com/minio/minio@/cmd/fs-v1-helpers.go:333:cmd.fsCreateFile()
3: github.com/minio/minio@/cmd/fs-v1.go:997:cmd.(*FSObjects).putObject()
2: github.com/minio/minio@/cmd/fs-v1.go:911:cmd.(*FSObjects).PutObject()
1: github.com/minio/minio@/cmd/data-usage.go:132:cmd.storeDataUsageInBackend()
API: SYSTEM()
Time: 08:41:31 UTC 06/12/2020
DeploymentID: 09a030fd-1772-4761-860b-8fc94753bb87
Error: Unexpected error, please report this issue at https://github.com/minio/minio/issues
4: github.com/minio/minio@/cmd/fs-v1-helpers.go:333:cmd.fsCreateFile()
3: github.com/minio/minio@/cmd/fs-v1.go:997:cmd.(*FSObjects).putObject()
2: github.com/minio/minio@/cmd/fs-v1.go:911:cmd.(*FSObjects).PutObject()
1: github.com/minio/minio@/cmd/data-usage.go:108:cmd.runDataUsageInfo()
API: SYSTEM()
Time: 08:41:31 UTC 06/12/2020
DeploymentID: 09a030fd-1772-4761-860b-8fc94753bb87
Error: Unexpected error, please report this issue at https://github.com/minio/minio/issues
1: github.com/minio/minio@/cmd/data-usage.go:134:cmd.storeDataUsageInBackend()
API: SYSTEM()
Time: 08:41:31 UTC 06/12/2020
DeploymentID: 09a030fd-1772-4761-860b-8fc94753bb87
Error: Unexpected error, please report this issue at https://github.com/minio/minio/issues
1: github.com/minio/minio@/cmd/data-usage.go:110:cmd.runDataUsageInfo()
@Denysss can be closed?