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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

File comparison displays the message "This file cannot be rendered in your browser" but source view works fine

I'm experiencing this problem with .sql files: I can view the source but when I look at commit details I get the message "This file cannot be rendered in your browser" and if I click on "Diff to previous" I get an endless spinning loading gif.

One strange thing is that while viewing the source, the first character of the first row is a little red dot.
If I move the mouse on the red dot there's a tooltip saying "\uteff"

Is someone experiencing the same problem?

We are using Stash 3.5 64bit on Centos 7

6 answers

1 accepted

3 votes
Answer accepted
Marcin Atlassian Team Dec 09, 2014

One of the reasons you're seeing issues with the diff is that your SQL files contain a Byte Order Mark (BOM), this is the 0xFEFF sequence you're seeing at the start of the file.  Unfortunately these bytes means git treats the file as binary, not text, and so any operations that depend on git, such as generating a diff, aren't going to return what you expect.

You would also see this behaviour if you did a git diff on some commits in your repo from the command line, as Stash calls out to git for all it's operations:

Binary files a/file.sql and b/file.sql differ

In order for git to properly diff your SQL files you would need to ensure they're saved without the BOM byte, or you could use a git filter to ensure the BOM gets stripped when you commit the file.

As for the issue with "Diff to previous" - that's a real bug in Stash 3.5 with binary files in the source view, I have raised STASH-6866 to track this.

I you are right! After removing the BOM from one of the SQL and commiting several modifications I can use the source comparison. Thank you very much for your help. :-) Now I must find a way to apply a git filter as you suggested. let's got o study. :-) Thank you again. Alessandro

What if the BOM is required for build purposes? I tried using .gitattributes to make git treat UTF-16 xml files as text, but they still won't show a diff in the Bitbucket diff despite being able to be displayed in a git diff.

I was able to resolve the issue by checking "Transcode Diffs". This resolved the issue with comparing sql files.


@ryanvgates  Thanks! Your answer is the correct one. No one can go around and remove BOM from the existing files.

Like # people like this

Dare I say ... this is the "BOM"!

Like # people like this

Worked like a charm! Thanks @Ryan Gates 

Like ryanvgates likes this
0 votes
Marcin Atlassian Team Dec 03, 2014

Any kind of SQL files in particular, or all SQL files? That is, are they large, small, what SQL dialect are they? Stash 3.5 introduced changes to syntax highlighting in the file view, so trying to work out what in particular is causing this.

It happens with every SQL file. they are SqlServer 2005 stored procedures

0 votes
Marcin Atlassian Team Dec 08, 2014

Would it be possible for you to open a support ticket at and attach an example of a file that exhibits this behaviour so that we can try and reproduce the issue?

Done, thank you. I opened the ticket number SSP-6608

Reviewing SSP-6608, I see that the problem was resolved after removing the BOM at the beginning of the file.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Bitbucket

How do you use the Bitbucket-Jira integration? How does it help your team?

Hey everyone, over the past year, we've added several new features on how you can use Bitbucket and Jira together. We'd love to know how you'll are using the integration and how it's helping your t...

88 views 0 2
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you