Skip to content

[BUG] Facing java.time.format.DateTimeParseException when listing emerging issues from ResourceHealthManager #43927

@drmoeller

Description

@drmoeller

Describe the bug
While trying to list emerging issues from ResourceHealthManager, following exception is thrown:

Exception or Stack Trace

Caused by: java.time.format.DateTimeParseException: Text '2025-01-24 07:34:05Z' could not be parsed at index 10
	at java.base/java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:2108)
	at java.base/java.time.format.DateTimeFormatter.parseBest(DateTimeFormatter.java:2056)
	at com.azure.core.util.CoreUtils.parseBestOffsetDateTime(CoreUtils.java:793)
	at com.azure.resourcemanager.resourcehealth.fluent.models.EmergingIssue.lambda$fromJson$4(EmergingIssue.java:153)
	at com.azure.json.JsonReader.getNullable(JsonReader.java:238)
	at com.azure.resourcemanager.resourcehealth.fluent.models.EmergingIssue.lambda$fromJson$7(EmergingIssue.java:153)
	at com.azure.json.JsonReader.readMapOrObject(JsonReader.java:551)
	at com.azure.json.JsonReader.readObject(JsonReader.java:455)
	at com.azure.resourcemanager.resourcehealth.fluent.models.EmergingIssue.fromJson(EmergingIssue.java:145)
	at com.azure.resourcemanager.resourcehealth.fluent.models.EmergingIssuesGetResultInner.lambda$fromJson$0(EmergingIssuesGetResultInner.java:216)
	at com.azure.json.JsonReader.readMapOrObject(JsonReader.java:551)
	at com.azure.json.JsonReader.readObject(JsonReader.java:455)
	at com.azure.resourcemanager.resourcehealth.fluent.models.EmergingIssuesGetResultInner.fromJson(EmergingIssuesGetResultInner.java:203)
	at com.azure.resourcemanager.resourcehealth.models.EmergingIssueListResult.lambda$fromJson$2(EmergingIssueListResult.java:116)
	at com.azure.json.JsonReader.readArray(JsonReader.java:494)
	at com.azure.resourcemanager.resourcehealth.models.EmergingIssueListResult.lambda$fromJson$3(EmergingIssueListResult.java:116)
	at com.azure.json.JsonReader.readMapOrObject(JsonReader.java:551)
	at com.azure.json.JsonReader.readObject(JsonReader.java:455)
	at com.azure.resourcemanager.resourcehealth.models.EmergingIssueListResult.fromJson(EmergingIssueListResult.java:108)
[...]

To Reproduce
Steps to reproduce the behavior: See code below.

Code Snippet
Kotlin code:

import com.azure.resourcemanager.resourcehealth.ResourceHealthManager

[...]

    ResourceHealthManager.authenticate(credential, profile)
      .emergingIssues()
      .list()
      .forEach { println("--- $it") }

Expected behavior
Either proper parsing of timestamp provided by Azure API, or adaption of Azure API response with properly formatted timestamp.

Screenshots
If applicable, add screenshots to help explain your problem.

Setup (please complete the following information):

  • OS: Linux
  • IDE: Same when executed via IntelliJ or shell
  • Library/Libraries: implementation("com.azure.resourcemanager:azure-resourcemanager-resourcehealth:1.1.0-beta.3")
  • Java version: 21
  • App Server/Environment: Local test case execution
  • Frameworks: Micronaut

Additional context
Add any other context about the problem here.

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added

Metadata

Metadata

Labels

MgmtThis issue is related to a management-plane library.Resource HealthService AttentionWorkflow: This issue is responsible by Azure service team.bugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions