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

URL parameter for core:archive console command is ignored #8316

Closed
astehlik opened this issue Jul 9, 2015 · 4 comments
Closed

URL parameter for core:archive console command is ignored #8316

astehlik opened this issue Jul 9, 2015 · 4 comments
Labels
Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Milestone

Comments

@astehlik
Copy link

astehlik commented Jul 9, 2015

I had a really strange issue today and it occured since the update to 2.14.0.

I'm using the command line interface for archiving:

php_cli /html/piwik/console core:archive --url=http://mydomain.tld/piwik/

During that call I got an error, because the script tried to use the IP address to access the Piwik Server which does not work because there is no virtual host entry for the IP.

I finally managed to figure out that there was in invalid URL written to piwikUrl setting which is used for making API calls.

I also managed to figure out where the IP address came from: Piwik was accessible from a host that was not added to the trusted hosts setting. Therefore the hostname is read from the SERVER_ADDR variable which contained the IP address instead of HTTP_HOST which contained the actual hostname.

I see two problems here:

1. URL parameter is ignored

The parameter passed to the console command --url is totally ignored when archiving is run. I would expect Piwik to use that parameter instead of the value that is stored in the piwikUrl setting to make API calls.

2. Trusted host setting is bypassed

When a HTTP_HOST header is provided and the host is not trusted there should be no fallback to SERVER_ADDR. Only when the HTTP_HOST is empty it should be possible to fallback to SERVER_ADDR.

I hope this makes sense to you :)

@mattab
Copy link
Member

mattab commented Jul 10, 2015

Hi @astehlik

can you try --piwik-domain= parameter instead: do you have the same issue?

@mattab mattab added this to the Mid term milestone Jul 15, 2015
@mattab
Copy link
Member

mattab commented Jul 15, 2015

Fyi: a workaround to this issue is to make sure your system supports managing Processes via CLI, ie. you need to:

  • use a non-windows server,
  • use a non-synology server,
  • have shell_exec enabled,
  • support ps, awk functions,
  • have a /proc filesystem.

@mattab mattab added the Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. label Jul 15, 2015
@mattab mattab added Regression Indicates a feature used to work in a certain way but it no longer does even though it should. and removed Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. labels Jul 23, 2015
@mattab mattab modified the milestones: 2.15.0, Mid term Jul 23, 2015
@mattab
Copy link
Member

mattab commented Jul 23, 2015

This was also (indirectly) reported in the forums: http://forum.piwik.org/read.php?2,128367

@mattab
Copy link
Member

mattab commented Jul 23, 2015

It was also reported in http://forum.piwik.org/read.php?2,128384

@diosmosis since many users report this issue as blocking for them to run the cron, could we restore this feature in 2.14.2 and not have to wait 2.15.0?

@diosmosis diosmosis modified the milestones: 2.14.2, 2.15.0 Jul 23, 2015
diosmosis pushed a commit that referenced this issue Jul 24, 2015
… that do not use systems that support CLI archiving.
mattab pushed a commit that referenced this issue Jul 24, 2015
Fixes #8316, re-add core:archive URL override functionality for usersthat do not use systems that support CLI archiving.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Regression Indicates a feature used to work in a certain way but it no longer does even though it should.
Projects
None yet
Development

No branches or pull requests

3 participants