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

Kibana 7.0.0 URL field formatter doesn't render relative hyperlinks properly #35235

Closed
dougburks opened this issue Apr 17, 2019 · 35 comments · Fixed by #53265
Closed

Kibana 7.0.0 URL field formatter doesn't render relative hyperlinks properly #35235

dougburks opened this issue Apr 17, 2019 · 35 comments · Fixed by #53265
Labels
bug Fixes for quality problems that affect the customer experience regression

Comments

@dougburks
Copy link

dougburks commented Apr 17, 2019

Kibana version:
Kibana 7.0.0 through Kibana 7.5.0

Elasticsearch version:
Elasticsearch 7.0.0 through Elasticsearch 7.5.0

Server OS version:
Ubuntu 16.04

Browser version:
Chromium 73

Browser OS version:
Ubuntu 16.04

Original install method (e.g. download page, yum, from source, etc.):
Docker

Describe the bug:
In Kibana 6.5.4, I can set a URL field formatter on an IP field using a relative hyperlink (no https://servername at the beginning) and it will render the hyperlink properly.

In Kibana 7.0.0 and higher, the same relative hyperlink on an IP field does not render properly. Further testing reveals that relative hyperlinks on string fields do render properly.

Steps to reproduce:

  1. Set a URL field formatter on an IP field to a relative hyperlink. For example: /RelativeHyperlink
  2. View the resulting formatted IP field on a dashboard.
  3. The field will not be hyperlinked and thus not clickable.

Expected behavior:
Kibana 7.0.0 and higher should render the hyperlink properly as previous versions of Kibana did.

Screenshots (if relevant):
Here's a screenshot of Kibana 6.5.4 rendering relative hyperlinks properly:
6 5 4_working_properly

Here's a screenshot of Kibana 7.0.0 rendering those same relative hyperlinks incorrectly:
7 0 0_not_rendering_properly

Errors in browser console (if relevant):

Provide logs and/or server output (if relevant):

Any additional context:

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-arch

@dougburks
Copy link
Author

Hi @lukeelmers ,

Thanks for adding the labels. I see that elasticmachine pinged the kibana-app-arch team, but if I click on that link (https://github.com/orgs/elastic/teams/kibana-app-arch), I get Page not found, so does that team no longer exist?

Please let me know if I can provide any more information to get this issue resolved.

Thanks!

@lukeelmers
Copy link
Member

Thanks @dougburks! Don’t worry, the ping went to the right team :) I’m guessing the team page is private to the elastic org maybe?

We are going to take a look at and will follow up with any questions for you.

@dougburks
Copy link
Author

Thanks for confirming @lukeelmers !

After more testing, it seems like this issue happens on fields of type IP, but not on fields of type string. I've updated the initial description to reflect this.

I've also been trying to pinpoint where in the source this URL formatting happens, but I'm not familiar with the Kibana codebase. It looks like in 6.5.4, the relevant file for URL formatting is src/core_plugins/kibana/common/field_formats/types/url.js but that file was moved in 7.0.0 to src/legacy/core_plugins/kibana/common/field_formats/types/url.js.

Am I on the right track?

@dougburks
Copy link
Author

I just tested Kibana 7.0.1 and this is still an issue:
7 0 1

Any chance of this getting resolved in 7.0.2?

Thanks!

@robcowart
Copy link

What I have found is that doesn't matter if it is an IP or a string. The issue occurs with both.

From my testing it occurs when a relative path URL is used.

For example the following relative URL worked in all 6.x versions through 6.6.2 (I didn't test later versions), but has problems with 7.x versions...

kibana#/dashboard/402b3910-068d-11e8-b8c9-63672ef3f062?_g=(filters:!(('$state':(store:globalState),meta:(alias:!n,disabled:!f,index:'logs-conn-*',key:conn.client_hostname,negate:!f,params:(query:'{{value}}',type:phrase),type:phrase,value:'{{value}}'),query:(match:(conn.client_hostname:(query:'{{value}}',type:phrase))))))

However when the full URL including domain is used, it works.

http://www.domain.name/app/kibana#/dashboard/402b3910-068d-11e8-b8c9-63672ef3f062?_g=(filters:!(('$state':(store:globalState),meta:(alias:!n,disabled:!f,index:'logs-conn-*',key:conn.client_hostname,negate:!f,params:(query:'{{value}}',type:phrase),type:phrase,value:'{{value}}'),query:(match:(conn.client_hostname:(query:'{{value}}',type:phrase))))))

Unfortunately adding the full URL as a workaround doesn't really work. Some users connect with only the IP address of the Kibana server, and other the full URL, which would be problematic. Also this would prevent the index pattern from being exported from one environment and imported into another (the server/domain name portion of the URL would be wrong in other environments).

What I also noticed is that not everything is affected. The field formatter configuration page, and the table visualization have the problem. However, viewing the field in Explorer (or a saved search) does not.

Table Visualization:

image

Saved search:

image

@dougburks
Copy link
Author

Just tested Kibana 7.2.0 and confirmed this is still an issue. Is there any other information I can provide to help with getting this issue resolved?

@lukeelmers lukeelmers self-assigned this Jul 2, 2019
@lukeelmers lukeelmers added the bug Fixes for quality problems that affect the customer experience label Jul 3, 2019
@bicaluv
Copy link

bicaluv commented Jul 8, 2019

I would like to upvote the issue.
We have a string field with url format and it worked till 6.7.1 and is now broken using 7.1.1

@dougburks
Copy link
Author

Just tested Kibana 7.3.1 and confirmed this is still an issue. Is there any other information I can provide to help with getting this issue resolved?

@bicaluv
Copy link

bicaluv commented Sep 9, 2019

Looks like that our problem is not important enough to get fixed :-(

@dougburks
Copy link
Author

Just tested Kibana 7.3.2 and confirmed this is still an issue. Is there any other information I can provide to help with getting this issue resolved?

@gospodarsky
Copy link

gospodarsky commented Sep 23, 2019

@bicaluv @dougburks Sorry for been a long time. The bug is being reviewed.

@alexfrancoeur
Copy link

Still an issue in 7.3 as well, the columns seem to work but the documents do not. This isn't just URL's, but images too.

image

Screen Shot 2019-09-26 at 12 37 08 PM

@alexfrancoeur
Copy link

@sulemanof are we able to close this with #46332 and #47464?

@alexfrancoeur
Copy link

sorry, it looks like @Avinar-24 created the original PR. Same question 😄

@gospodarsky
Copy link

@alexfrancoeur Yes, it will be delivered with 7.4.x

@lukasolson
Copy link
Member

Closed via #46332.

@bhavyarm bhavyarm reopened this Oct 21, 2019
@bhavyarm
Copy link
Contributor

Not fixed in 7.4.1 in this PR: #46332

@dougburks
Copy link
Author

Just tested Kibana 7.5.0 and confirmed this issue still exists there:

Kibana-bug-7 5 0

As always, please let me know if I can provide any further information to help get this issue properly resolved.

Thanks!

alexwizp added a commit to alexwizp/kibana that referenced this issue Dec 12, 2019
alexwizp added a commit to alexwizp/kibana that referenced this issue Dec 13, 2019
@alexwizp alexwizp reopened this Dec 13, 2019
alexwizp added a commit to alexwizp/kibana that referenced this issue Dec 24, 2019
alexwizp added a commit that referenced this issue Dec 26, 2019
…inks properly (#53789)

Closes: #35235 (fix for 7.5)

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@mike-treadway
Copy link

This is still broken for me in 7.5.2. I've put a better fix in place directly in the UrlFormat class that seems to fix this, however I also see a similar fix already done in master.

How soon will we get the next version with the fix in master? Shall I submit a PR in the meantime if there's going to be a 7.5.3?

@AlonaNadler
Copy link

@mike-treadway thanks for letting us know. The user who opened this issue actually told me today that this PR actually helped fix the issue.

This is still broken for me in 7.5.2

To avoid assumptions, can you please elaborate more on what do you mean by still broken

@mike-treadway
Copy link

mike-treadway commented Jan 22, 2020

Sure. When we configure a relative URL for a field in an index, the field just renders as text (the relative url is the text) on our dashboard. If I change the field to an absolute URL, it renders as a link with the original field value as the text of the link (which is expected).

The problem is that in the context of getting the formatter, it's not able to send the parsedUrl parameter to the formatter. So when the formatter doesn't see the URL start with http and it doesn't have a parsedUrl parameter, it just returns a <span>URL TEXT<span> instead of an href within the span.

If you'd like, I can commit the change in my fork if you want to review. I just attempted to test what's in master and it looks like you guys are gearing up for v8.

image

@dougburks
Copy link
Author

Interesting. I only tested 7.5.2 for a few minutes this morning but it seemed to be working correctly for the few test cases I looked at. Perhaps there is some other corner case somewhere that I didn't test though. I'll try to re-test as time allows.

@mike-treadway
Copy link

It only seems to work when the mapping is for a terms field (i.e. the mapping id was terms) and falls into this case:

https://github.com/elastic/kibana/blob/v7.5.2/src/legacy/ui/public/visualize/loader/pipeline_helpers/utilities.ts#L131

In my situation, the mapping was of type url and was falling into the default case:

https://github.com/elastic/kibana/blob/v7.5.2/src/legacy/ui/public/visualize/loader/pipeline_helpers/utilities.ts#L156

where the field formatter never gets a parsedUrl parameter.

mike-treadway added a commit to mike-treadway/kibana that referenced this issue Jan 23, 2020
@lukeelmers
Copy link
Member

This issue was fixed in #53265, which was merged into master and 7.6. However, due to some large refactoring that has been happening as we work on migrating core Kibana plugins to our new platform, it wasn't feasible to apply the same change to the 7.5 branch as it had diverged too far from master. As a result, a one-off fix was applied directly to 7.5 to ensure the issue would still be addressed in 7.5.2 (#53789).

The one-off fix released in 7.5.2 resolved the use case that @dougburks originally described in this issue, but not the additional case @mike-treadway has found.

The long-term fix which is on master should address both cases in the 7.6 release, which will be coming sometime in the near term.

@mike-treadway Just to triple-check, would you be able to confirm that everything is working as expected for you in the 7.6 branch?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience regression
Projects
None yet
Development

Successfully merging a pull request may close this issue.