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

Piwik update notification email links to the internal Piwik instance IP address but should link to the trusted hostname value instead #11029

Closed
mattab opened this issue Dec 17, 2016 · 5 comments · Fixed by #14422
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Dec 17, 2016

Report from email:

Update notification uses IP address instead of the (first) valid hostname from the config.

Hallo,

Er is een nieuwe versie van Piwik beschikbaar als update

U kunt automatisch updaten naar versie 3.0.0-rc2 of het pakket downloaden en handmatig installeren.
https://192.168.210.10/index.php?module=CoreUpdater&action=newVersionAvailable

Voel je vrij om je ideeën en suggesties te delen met het Piwik team:
http://piwik.org/contact/
  • 192.168.210.10 should be instead "analytics.example.com" from the trusted_hosts array in the config.ini.php
@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label Dec 17, 2016
@mattab
Copy link
Member Author

mattab commented Feb 20, 2017

This may be the same issue as: #6644

@mattab mattab added this to the Backlog (Help wanted) milestone Feb 20, 2017
@mattab mattab added the Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement. label Nov 19, 2017
@pestevao
Copy link

I think that they are differente issues.
It only happens to us this in email reports and always resolve to 127.0.0.1 which is not used to configure any trusted_hosts entries.

tsteur added a commit that referenced this issue Jul 1, 2018
refs a couple of issues I think. Eg #11029 

For some reason that I cannot explain, it stored `127.0.0.1` as the matomo URL in the DB causing a bug in tag manager. So I opened a regular page in Matomo and was expecting it to correct the value in the option table but it didn't. I think this is because of the above change where it checks whether the previous URL is not a local host whereas it maybe should check on the current URL? 

See the debugger picture where it did not overwrite 127.0.0.1 with the correct current url/host because the host is currently a local host (127.0.0.1). If it checked whether the actual host is a local host, it would have updated it.
sgiehl pushed a commit that referenced this issue Jul 2, 2018
refs a couple of issues I think. Eg #11029 

For some reason that I cannot explain, it stored `127.0.0.1` as the matomo URL in the DB causing a bug in tag manager. So I opened a regular page in Matomo and was expecting it to correct the value in the option table but it didn't. I think this is because of the above change where it checks whether the previous URL is not a local host whereas it maybe should check on the current URL? 

See the debugger picture where it did not overwrite 127.0.0.1 with the correct current url/host because the host is currently a local host (127.0.0.1). If it checked whether the actual host is a local host, it would have updated it.
InfinityVoid pushed a commit to InfinityVoid/matomo that referenced this issue Oct 11, 2018
refs a couple of issues I think. Eg matomo-org#11029 

For some reason that I cannot explain, it stored `127.0.0.1` as the matomo URL in the DB causing a bug in tag manager. So I opened a regular page in Matomo and was expecting it to correct the value in the option table but it didn't. I think this is because of the above change where it checks whether the previous URL is not a local host whereas it maybe should check on the current URL? 

See the debugger picture where it did not overwrite 127.0.0.1 with the correct current url/host because the host is currently a local host (127.0.0.1). If it checked whether the actual host is a local host, it would have updated it.
@GavL89
Copy link

GavL89 commented May 6, 2019

@tsteur - in relation to the closed issue #14413, no, none of the trusted hostnames are IP addresses. This is what the general section of our config.ini.pho file looks like

[General]
salt = "xxxxxxxxxx"
trusted_hosts[] = "analytics.ap-southeast-2.domain.com"
proxy_client_headers[] = "HTTP_X_FORWARDED_FOR"
proxy_host_headers[] = "HTTP_X_FORWARDED_HOST"
cors_domains[] = "*"
session_save_handler = dbtable
multi_server_environment=1
noreply_email_address = "noreply@domain.com"

@tsteur
Copy link
Member

tsteur commented May 6, 2019

Was also reported here: #14413

I wonder: Maybe SettingsPiwik::getPiwikUrl should only store a url/hostname that is configured in the trusted hostnames once Matomo is installed and shouldn't overwrite a URL that isn't set as trusted url? Not sure if that would cause any issues but might be a good idea.

I've also tried updating the piwikUrl row in the database however it just gets updated by itself to the IP address of one of the servers.

@GavL89 it does look like the proxy header isn't actually forwarded cause the app should use it otherwise.

@tsteur
Copy link
Member

tsteur commented May 6, 2019

@GavL89 I reckon we have kind of an idea where the problem is and will likely create a fix for this as part of 3.10 or 3.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. Help wanted Beginner friendly issues or issues where we'd highly appreciate community's help and involvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants