Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Urgent: Sudden issue started with GetDataFactoryPipeline function #4825

Open
2 of 9 tasks
divyeshgohil85 opened this issue Sep 4, 2024 · 5 comments
Open
2 of 9 tasks
Assignees
Labels
customer-reported issue-addressed question Further information is requested

Comments

@divyeshgohil85
Copy link

divyeshgohil85 commented Sep 4, 2024

Link to sample

No response

Library name and version

Package= Azure.ResourceManager.DataFactory, Version=1.1.0

Language of the Sample

  • C#/.NET
  • Java
  • JavaScript/TypedScript
  • Python
  • Golang
  • Other - Please specify in Issue details field

Sample Issue Type

  • Sample not working
  • Sample missing
  • Do not understand sample

Issue details

I've been using the Azure.ResourceManager.DataFactory SDK and recently encountered an issue. Previously, I used the GetDataFactoryPipeline method to retrieve my pipeline details and then run it in the next step. This setup has been working fine. However, yesterday, when I tried to run the pipeline, it threw an exception from the GetDataFactoryPipeline method.

The stack trace is:

System.InvalidCastException
HResult=0x80004002
Message=Unable to cast object of type 'System.Collections.Generic.Dictionary2[System.String,System.Object]' to type 'System.String'. Source=Azure.Core.Expressions.DataFactory StackTrace: at Azure.Core.Expressions.DataFactory.DataFactoryElementJsonConverter.Deserialize[T](JsonElement json) at Azure.Core.Expressions.DataFactory.DataFactoryElementJsonConverter.Read(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options) at System.Text.Json.Serialization.JsonConverter1.ReadAsObject(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options)
at System.Text.Json.Serialization.JsonConverter1.TryRead(Utf8JsonReader& reader, Type typeToConvert, JsonSerializerOptions options, ReadStack& state, T& value, Boolean& isPopulatedValue) at System.Text.Json.Serialization.JsonConverter1.ReadCore(Utf8JsonReader& reader, JsonSerializerOptions options, ReadStack& state)
at System.Text.Json.JsonSerializer.ReadFromSpan[TValue](ReadOnlySpan1 json, JsonTypeInfo1 jsonTypeInfo)
at System.Text.Json.JsonSerializer.Deserialize[TValue](String json, JsonSerializerOptions options)
at Azure.ResourceManager.DataFactory.Models.WebActivity.DeserializeWebActivity(JsonElement element, ModelReaderWriterOptions options)
at Azure.ResourceManager.DataFactory.Models.PipelineActivity.DeserializePipelineActivity(JsonElement element, ModelReaderWriterOptions options)
at Azure.ResourceManager.DataFactory.DataFactoryPipelineData.DeserializeDataFactoryPipelineData(JsonElement element, ModelReaderWriterOptions options)
at Azure.ResourceManager.DataFactory.PipelinesRestOperations.Get(String subscriptionId, String resourceGroupName, String factoryName, String pipelineName, String ifNoneMatch, CancellationToken cancellationToken)
at Azure.ResourceManager.DataFactory.DataFactoryPipelineCollection.Get(String pipelineName, String ifNoneMatch, CancellationToken cancellationToken)
at Azure.ResourceManager.DataFactory.DataFactoryResource.GetDataFactoryPipeline(String pipelineName, String ifNoneMatch, CancellationToken cancellationToken)
at Domains.Datafactory.DatafactoryDomain.d__11.MoveNext() in D:\Project\Arne_Clo\azure-data-factory-integration-dot-net\Domains\Datafactory\DatafactoryDomain.cs:line 73

Above stack track trace states that something strange is released and the object is changed from System.String to System.Collections.Generic.Dictionary`2[System.String,System.Object].

I did not see any parameter changes for the same function (GetDataFactoryPipeline), I believe this is an internal issue and want this issue to address ASAP.

image

Expected behavior

No response

Actual behavior

No response

Reproduction Steps

No response

Environment

Runtime Environment:
OS Name: Windows
OS Version: 10.0.22621
OS Platform: Windows
RID: win-x64

@live1206
Copy link
Member

@HarveyLink Please help take a look at this, thanks!

@live1206 live1206 removed their assignment Oct 28, 2024
@welovej
Copy link
Member

welovej commented Oct 30, 2024

Hi @divyeshgohil85, sorry, but I couldn't find the method GetDataFactoryResource() in Azure.ResourceManager.DataFactory. Could you provide a bit more context?

@divyeshgohil85
Copy link
Author

Hi, we have implemented logic to fetch factory resources. Using armClient, we retrieve a subscriptionResource, and from this subscriptionResource, we can access a dataFactory resourceGroupResource.

Please refer to the attachment below.
Image

@HarveyLink HarveyLink assigned welovej and unassigned HarveyLink Nov 20, 2024
@welovej
Copy link
Member

welovej commented Dec 10, 2024

@divyeshgohil85 I reproduced the issue, and no exceptions were found. Please check the attachment below.

Image

@divyeshgohil85
Copy link
Author

divyeshgohil85 commented Dec 12, 2024

Hi,

Thank you for taking the time.

Based on your response, I tried to replicate the issue and reviewed the error. I discovered there was a glitch on my part.

Here’s a detailed explanation:

In my pipeline, there are two web activities. The first activity uses the POST method. I duplicated this activity and changed its method from POST to GET but forgot to remove the body.

As a result, the second activity retained the body even though the method was changed to GET. While the ADF UI does not display the body, it still exists in the backend.

When I attempted to execute this pipeline via code, it resulted in an error. To resolve this, I temporarily changed the method of the second activity back to POST, removed the body, and then switched the method back to GET.

This adjustment resolved the issue, and I was able to execute the pipeline successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer-reported issue-addressed question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants