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

When deploying via git and using absolute paths, console archive script gives errors about GIT_DISCOVERY_ACROSS_FILESYSTEM not being set #8771

Closed
nekohayo opened this issue Sep 13, 2015 · 5 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Milestone

Comments

@nekohayo
Copy link

I set up a test instance on a dedicated server, to test log processing performance. Interestingly enough, I hit an error that my previous host sysadmins (hostgator) encountered but that I had not encountered myself until now:

$ php /srv/piwik_test/console core:archive --url=http://the_website_url
fatal: Not a git repository (or any parent up to mount point /srv)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
INFO [2015-09-13 03:56:05] ---------------------------
INFO [2015-09-13 03:56:05] INIT
INFO [2015-09-13 03:56:05] Running Piwik 2.14.3 as Super User
INFO [2015-09-13 03:56:05] ---------------------------
[…]
INFO [2015-09-13 03:56:05] - Archiving was last executed without error 5 days 7 hours ago
INFO [2015-09-13 03:56:05] Will invalidate archived reports for 2015-09-08 for following siteIds: 2,4
INFO [2015-09-13 03:56:05] Will invalidate archived reports for 2015-09-09 for following siteIds: 2,4,5
INFO [2015-09-13 03:56:05] Will invalidate archived reports for 2015-09-11 for following siteIds: 4
INFO [2015-09-13 03:56:05] Will invalidate archived reports for 2015-09-10 for following siteIds: 5
INFO [2015-09-13 03:56:05] Will invalidate archived reports for 2015-09-12 for following siteIds: 5
INFO [2015-09-13 03:56:05] - Will process 3 websites with new visits since 5 days 7 hours , IDs: 2, 4, 5
INFO [2015-09-13 03:56:05] - Will process 3 other websites because some old data reports have been invalidated (eg. using the Log Import script) , IDs: 5, 2, 4
INFO [2015-09-13 03:56:05] ---------------------------
INFO [2015-09-13 03:56:05] START
INFO [2015-09-13 03:56:05] Starting Piwik reports archiving...
INFO [2015-09-13 03:56:05] Will pre-process for website id = 2, period = day, date = last52
INFO [2015-09-13 03:56:05] - pre-processing all visits
ERROR [2015-09-13 03:56:55] Empty or invalid response 'fatal: Not a git repository (or any parent up to mount point /srv) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). a:52:{s:10:"2015-07-23";a:21: […blah blah bunch of text here…]
INFO [2015-09-13 03:56:55] Will pre-process for website id = 4, period = day, date = last52
INFO [2015-09-13 03:56:55] - pre-processing all visits

(the script continues and hits the error for every website ID)

INFO [2015-09-13 03:58:04] Done archiving!
INFO [2015-09-13 03:58:04] ---------------------------
INFO [2015-09-13 03:58:04] SUMMARY
INFO [2015-09-13 03:58:04] Total visits for today across archived websites: 0
INFO [2015-09-13 03:58:04] Archived today's reports for 0 websites
INFO [2015-09-13 03:58:04] Archived week/month/year for 0 websites
INFO [2015-09-13 03:58:04] Skipped 3 websites: no new visit since the last script execution
INFO [2015-09-13 03:58:04] Skipped 0 websites day archiving: existing daily reports are less than 10000 seconds old
INFO [2015-09-13 03:58:04] Skipped 0 websites week/month/year archiving: existing periods reports are less than 3600 seconds old
INFO [2015-09-13 03:58:04] Total API requests: 0
INFO [2015-09-13 03:58:04] done: 0/3 0%, 0 vtoday, 0 wtoday, 0 wperiods, 0 req, 119304 ms, 3 errors.
INFO [2015-09-13 03:58:04] Time elapsed: 119.305s
INFO [2015-09-13 03:58:04] ---------------------------
INFO [2015-09-13 03:58:04] SCHEDULED TASKS
INFO [2015-09-13 03:58:04] Starting Scheduled tasks... 
INFO [2015-09-13 03:58:04] Scheduler: executing task Piwik\Plugins\ExamplePlugin\Tasks.myTask...
INFO [2015-09-13 03:58:04] Scheduler: finished. Time elapsed: 0.000s
INFO [2015-09-13 03:58:04] Scheduler: executing task Piwik\Plugins\PerformanceMonitor\Tasks.getMaxVisits...
INFO [2015-09-13 03:58:04] Scheduler: finished. Time elapsed: 0.050s
INFO [2015-09-13 03:58:04] done
INFO [2015-09-13 03:58:04] ---------------------------
INFO [2015-09-13 03:58:04] ---------------------------
INFO [2015-09-13 03:58:04] SUMMARY OF ERRORS

(the same errors get repeated again)

ERROR [2015-09-13 03:58:04] 3 total errors during this script execution, please investigate and try and fix these errors.

  [Exception]                                                                                    
  3 total errors during this script execution, please investigate and try and fix these errors.

For what it's worth, as per issue #8717, I had set up my environment as:

git clone https://github.com/piwik/piwik.git /srv/piwik_test
git checkout 2.14.3
git submodule update --init --recursive
curl -sS https://getcomposer.org/installer | php 
php composer.phar install --no-dev
./console development:disable

So technically there is a .git folder in the piwik_test root directory, but not in its parent (/srv) or "/".

Now, I think I might have found the issue: this occurs if you run my command with the full absolute path, but I think it doesn't happen if going into the directory to execute the script. So instead of:

$ php /srv/piwik_test/console core:archive --url=http://the_website_url

You need to use this workaround:

$ cd /srv/piwik_test/
$ php console core:archive --url=http://the_website_url

Would be nice if it can work even with an absolute path?

@mattab mattab added the Bug For errors / faults / flaws / inconsistencies etc. label Sep 20, 2015
@mattab mattab added this to the Short term milestone Sep 20, 2015
@mattab
Copy link
Member

mattab commented Sep 21, 2015

Thanks for the report @nekohayo - it was also reported in #8679

@mattab mattab changed the title When using absolute paths, console archive script gives errors about GIT_DISCOVERY_ACROSS_FILESYSTEM not being set When deploying via git and using absolute paths, console archive script gives errors about GIT_DISCOVERY_ACROSS_FILESYSTEM not being set Oct 21, 2015
@nekohayo
Copy link
Author

nekohayo commented Nov 3, 2015

Hi @mattab, the problem I have with this is that you can't really have a relative path when it's inside a cron script as per http://piwik.org/docs/setup-auto-archiving/ ...no? Or is there a way for it to cd before doing the command?

@mattab
Copy link
Member

mattab commented Nov 3, 2015

yes there is a way such as: { cd ~/www ; ./console core:archive ; }

@nekohayo
Copy link
Author

nekohayo commented Nov 3, 2015

Ah great, thank you for the workaround! That'll give me some breathing room until the official fix :)

@mattab
Copy link
Member

mattab commented Sep 26, 2016

@nekohayo could you please try this patch: https://github.com/piwik/piwik/pull/10532/files
which should hopefully fix the issue? Thanks to @bkbeckman

@mattab mattab modified the milestones: 3.0.0-b1, Mid term Sep 26, 2016
@mattab mattab closed this as completed Sep 27, 2016
@mattab mattab added the not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. label Oct 5, 2016
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. not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

No branches or pull requests

2 participants