Giter Site home page Giter Site logo

Comments (9)

abhibeckert avatar abhibeckert commented on June 10, 2024

I had to add --config path/to/config/config.ini.php.

from matomo-log-analytics.

ignace72 avatar ignace72 commented on June 10, 2024

Hello, abhibeckert.
Okay, I'll do that.
Thank you very much.

from matomo-log-analytics.

ignace72 avatar ignace72 commented on June 10, 2024

Good evening.
I added the option (with also idsite) and it still doesn't work.
Here is the message from the terminal:

Traceback (most recent call last):
  File "/opt/matomo/matomo-log-analytics/./import_logs.py", line 1588, in _call_api
    return json.loads(res)
  File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/matomo/matomo-log-analytics/./import_logs.py", line 2688, in <module>
    resolver = config.get_resolver()
  File "/opt/matomo/matomo-log-analytics/./import_logs.py", line 1131, in get_resolver
    return StaticResolver(self.options.site_id)
  File "/opt/matomo/matomo-log-analytics/./import_logs.py", line 1663, in __init__
    site = matomo.call_api(
  File "/opt/matomo/matomo-log-analytics/./import_logs.py", line 1647, in call_api
    return self._call_wrapper(self._call_api, None, None, method, **kwargs)
  File "/opt/matomo/matomo-log-analytics/./import_logs.py", line 1599, in _call_wrapper
    response = func(*args, **kwargs)
  File "/opt/matomo/matomo-log-analytics/./import_logs.py", line 1590, in _call_api
    raise urllib.error.URLError('Matomo returned an invalid response: ' + res.decode("utf-8") )
AttributeError: 'str' object has no attribute 'decode'

If anyone has any idea what the problem is?
Thank you.

from matomo-log-analytics.

marcbria avatar marcbria commented on June 10, 2024

Same issue with a dockerized matomo:4.14.1 and debian 11.

First issue is the config path that could be fixed with "-config" parameter.
Second issue when calling the script... probably because debian 11 is released with python3.9 and script requires 3.7 max?

from matomo-log-analytics.

ignace72 avatar ignace72 commented on June 10, 2024

Hello, marcbria.
Uh, the script would not be compatible out of the box with one of the most used GNU/Linux distributions for WEB servers!
I think in dreaming.
Well, I'll see if I can install Python 3.7, I'll come back here to tell if it worked.
Thank you very much.

from matomo-log-analytics.

marcbria avatar marcbria commented on June 10, 2024

I'm a community member... as lost with this as you. ;-)

The script comments talk about 3.5, 3.6 or 3.7 so I'm installing python3.7 right now but I just realize README talks about Python 3.5, 3.6, 3.7, 3.8, 3.9, 3.10.

PD: Tooo late in this side of the earth... I will continue tomorrow.

from matomo-log-analytics.

ignace72 avatar ignace72 commented on June 10, 2024

I am not incriminating you in any way.
Far from me, this idea.
I can imagine that you are as surprised as I am.
It's very late here too, but as I sleep very little, I'm used to it.
Good night to you.

from matomo-log-analytics.

marcbria avatar marcbria commented on June 10, 2024

No offense at all.
I installed python3.7 and the problem persisted.

I think the error was more simple than this... I'm tying now with the matomo URL in the url (instead of the place I wanted to track that is referenced by the id param) and I also added a tokenauth.

Call is:

python3 import_logs.py --url=https://YourMatomoUrl --idsite=1 --recorders=8 --enable-http-errors --enable-http-redirects --enable-static --enable-bots /usr/local/apache2/logs/access.log --token-auth=YOURTOKEN

Looks like is working but I'm analyzing 4GB of logs so I can tell for sure... till tomorrow.

from matomo-log-analytics.

ignace72 avatar ignace72 commented on June 10, 2024

Great, obviously you found it, I will test this when I am calmer.
Then I prefer to wait wisely to be sure that you are without surprise before the end of the treatment.
Obviously, 4GB is a lot.
I have smaller files, easier to read.

Edited:
Good, it processes the file (12 MiB).
But I have to search for adding my old access.log files to Matomo.
It's, well, the situation is progressing.

Edited:
I finished the first file, 21 more to go.
Some are a few megs, some are a hundred.
Well, I'll sleep better tonight.
Once I get going, I better not stop.

Edited:
I collected the access.log. files in a directory and ran the command with as access.log.* file which processes all the files in the directory and there is nothing to do but wait.

Eidted:
Thanks to you, abhibeckert and marcbria.
The problem being solved, I close the thread.

from matomo-log-analytics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.