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

Error when creating file #80

Open
rstylo opened this issue May 4, 2021 · 5 comments
Open

Error when creating file #80

rstylo opened this issue May 4, 2021 · 5 comments
Labels
bug Something isn't working

Comments

@rstylo
Copy link

rstylo commented May 4, 2021

Describe the bug
I get an error when i call _client.File.Create()
This stopped working a week ago 😭

Message
Error converting value {null} to type 'System.Int64'. Path 'data.file_size', line 1, position 201.
Stack:

 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.EnsureType(JsonReader reader, Object value, CultureInfo culture, JsonContract contract, Type targetType)     
 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)     
 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)     
 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)     
 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)     
 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)     
 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.SetPropertyValue(JsonProperty property, JsonConverter propertyConverter, JsonContainerContract containerContract, JsonProperty containerProperty, JsonReader reader, Object target)     
 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.PopulateObject(Object newObject, JsonReader reader, JsonObjectContract contract, JsonProperty member, String id)     
 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)     
 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)     
 at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)     
 at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)     
 at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)     
 at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)     
 at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value)     
 at Pipedrive.Internal.JsonHttpPipeline.DeserializeResponse[T](IResponse response)     
 at Pipedrive.Connection.Run[T](IRequest request, CancellationToken cancellationToken)     
 at Pipedrive.ApiConnection.Post[T](Uri uri, Object data, String accepts, String contentType)     
 at Pipedrive.FilesClient.Create(NewFile data) 

My method:

await _client.File.Create(new NewFile(new RawFile(_scans[0].PaperTemplate.Template.Replace(".docx", "") + ".pdf", _pdfFile, "application/pdf"))
{
    DealId = createdDeal.Id
});
@DavidRouyer
Copy link
Owner

Hi there!

Could you please share the Pipedrive.net version you're using? Can you try with the 0.5.11 release?
Can you give me more details?

I tried with the latest version and it works:

var file = System.IO.File.ReadAllBytes("a_file.pdf");

await client.File.Create(new NewFile(new RawFile("a_file.pdf", file, "application/pdf")) { DealId = 1 });

@rstylo
Copy link
Author

rstylo commented May 5, 2021

Hi David,

Thank you for the fast response.
I updated to the latest stable version Version="0.5.11" but it still did not work.
Then I tested it on a Sandbox account and file upload worked.

So maybe settings in the pipedrive account are wrong.
I'll investigate further.

@DavidRouyer
Copy link
Owner

I also tried on a sandbox account!
Have you recently added one of Pipedrive's file integration (the one with Google Drive for example: https://hopfab2.pipedrive.com/settings/files)?

@DavidRouyer DavidRouyer added the bug Something isn't working label May 28, 2021
@rstylo
Copy link
Author

rstylo commented Jul 1, 2021

Hello David,
sorry for the late response.
But our customer found that they did not have the correct rights on their google drive account

Thank you for the feedback

@rstylo rstylo closed this as completed Jul 1, 2021
@rstylo
Copy link
Author

rstylo commented Jun 26, 2023

Hi David,

So apparently this bug was never fixed and now it causes problems for me.
Is it possible to fix it?

@rstylo rstylo reopened this Jun 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants