Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,559,293
Community Members
 
Community Events
184
Community Groups

Bitbucket error: Unexpected character encountered while parsing value: <. Path '', line 0, position

We use Atlassian.Stash - C# API wrapper for Atlassian Stash, version v4.0.30319

C# .Net 4.8, Windows 10/1909

We migrated from Bitbucket Server to Bitbucket org, and have the error: Unexpected character encountered while parsing value: <. Path '', line 0, position 0

 try
{
var client = new StashClient(ConfigParametres.GitBaseURL, username, password);
ResponseWrapper<Atlassian.Stash.Entities.Commit> allCommits = await client.Commits.Get("PROJECT_KEY", "REPOSITORY_NAME", null, null);
if (allCommits.Values == null)
{
return false;
}
}
catch (Exception ex)
{
return false;
}

2 answers

I solve this issue by removing # and $ characters from my password. 

0 votes
Ulrich Kuhnhardt _IzymesCo_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
Oct 20, 2021

Hi Mark,

Bitbucket Server aka Stash and Bitbucket cloud are 2 different products with 2 completely different REST APIs. Any client written to work with Bitbucket Server will not work as the URL paths will be completely different.

I would expect you will get a 404 not found HTML page as a response which cannot be parsed.

Here is the BBCloud REST API https://developer.atlassian.com/bitbucket/api/2/reference/

I'm not aware of a ready-to use client, but it may be out there.

Hi Ulrich,

 

We used https://github.com/jlouros/StashApiCSharp

Do you know about BBCloud analogue? I mean C# library.

Ulrich Kuhnhardt _IzymesCo_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
Oct 20, 2021

Unfortunately not, Mark.

We switched to another library

https://github.com/lvermeulen/Bitbucket.Cloud.Net

But there is an error when calling GetRepositoryCommitsAsync()

Source "Flurl.Http"

Message "Response could not be deserialized to JSON: GET https://bitbucket.org/2.0/repositories/bxbts/smscore/commits"

InnerException

Source "Newtonsoft.Json"

StackTrace

at Newtonsoft.Json.JsonTextReader.ParseValue()
at Newtonsoft.Json.JsonTextReader.Read()
at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader)
at Flurl.Http.Configuration.NewtonsoftJsonSerializer.Deserialize[T](Stream stream)
at Flurl.Http.HttpResponseMessageExtensions.<ReceiveJson>d__0`1.MoveNext()

Message "Unexpected character encountered while parsing value: <. Path '', line 0, position 0." 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events