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

don't use defined proxy when executing CliMulti via core:archive #315

Open
ThaDafinser opened this issue Jun 13, 2014 · 8 comments
Open
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.

Comments

@ThaDafinser
Copy link
Contributor

Hello,

i have an outgoing company proxy. To use marketplace and updated, i've defined it in my config:

[proxy]
host = "proxy.domain.com"
port = 8090

The problem is now that the console core:archive command doesnt work anymore.
When i remove the proxy it works like.

So i can currently use the marketplace or archive command.....but not both.

Why an CLI program needs a HTTP request to the installation at all?

Second problem (solved):
The console core:archive needs curl, i hadn't installed it first -> had to debug it because the error message was not really good: ".....you have to increase memory limit normally" or something like that

@ThaDafinser ThaDafinser reopened this Jun 18, 2014
@ThaDafinser ThaDafinser changed the title Proxy issue 2.3.0 Proxy issue Jun 18, 2014
@mattab mattab changed the title 2.3.0 Proxy issue Proxy issue Jul 2, 2014
@mattab mattab added the Bug label Aug 3, 2014
@mattab
Copy link
Member

mattab commented Aug 3, 2014

Why an CLI program needs a HTTP request to the installation at all?

In your Settings > System check, do you see "Ok" next to "Managing CLI processes" item?

@mattab mattab added this to the Short term milestone Aug 3, 2014
@ThaDafinser
Copy link
Contributor Author

With a proxy is defined or not, I see:
Archive Cron (green check icon) Managing processes via CLI: not supported (optional)

@mattab
Copy link
Member

mattab commented Aug 4, 2014

Why an CLI program needs a HTTP request to the installation at all?

The CLI has a few required checks before it can be used: https://github.com/piwik/piwik/blob/master/core/CliMulti/Process.php#L142-166

@mattab
Copy link
Member

mattab commented Aug 4, 2014

had to debug it because the error message was not really good: ".....you have to increase memory limit normally" or something like that

Ok that sounds like a bug. Feel free to create ticket for it or even pull request :-)

@mattab
Copy link
Member

mattab commented Aug 4, 2014

can you try to type the ./console core:archive --url=X -v
and then paste output? the -v will enable verbose output which will give some more info

@mattab mattab changed the title Proxy issue don't use defined proxy when executing CliMulti via core:archive Dec 1, 2014
@mattab
Copy link
Member

mattab commented Dec 1, 2014

maybe a solution could be to "ignore" the proxy settings when attempting to contact

  • localhost / 127.0.0.1 etc.
  • a hostname found within the trusted_hosts array in config file

We'd have to document this in the proxy FAQ as maybe some users don't want it somehow and could let us know

@pzystorm
Copy link

I have the same problem and have used the idea from #6711
This is now my patch file and it works:

--- piwik_dist/core/Http.php    Mon Jan  5 05:35:22 2015
+++ piwik/core/Http.php Thu Jan 29 13:25:32 2015
@@ -161,6 +161,16 @@
         $proxyPort = Config::getInstance()->proxy['port'];
         $proxyUser = Config::getInstance()->proxy['username'];
         $proxyPassword = Config::getInstance()->proxy['password'];
+        $proxyExcludes = explode(" ", Config::getInstance()->proxy['excludes']);
+        foreach($proxyExcludes as $proxyExclude)
+        {
+            if (strpos($aUrl, $proxyExclude) !== false)
+            {
+                $proxyHost = '';
+                $proxyPort = '';
+                break;
+            }
+        }

         $aUrl = trim($aUrl);

and in the config/config.ini.php I have:

[proxy]
host = "ip.of.my.proxy"
port = 8080
excludes = "127.0.0.1 192.168.1.2"

@ThaDafinser
Copy link
Contributor Author

Just got (sadly) back to this issue.

My archives were exploding from 200MB to 5GB and i was wondering why.

When executing php console core:archive --url=http://xxx/ the ScheduldedTask wanted to execute GeoIPAutoUpdater and failed, because the connection failed.

Somehow some rows were written to the archive and some not, so the archive exploded (need to verify that a bit)

The core:archive was last sucessfull 27 days ago, because of the GeoIPAutoUpdater.

Cant we make a "special" dispatch for the console core:archive which does "ignore" ScheduldedTasks and such things? So it can never fail because of "3rd" party code

@mattab mattab added Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change. and removed Bug For errors / faults / flaws / inconsistencies etc. labels Apr 9, 2015
@mattab mattab modified the milestones: Mid term, Short term Apr 9, 2015
@mattab mattab modified the milestones: Long term, Mid term Dec 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

No branches or pull requests

3 participants