20c / vaping

vaping is a healthy alternative to SmokePing!
Apache License 2.0
479 stars 68 forks source link

Still blank on modern python librarys #173

Open decryptedchaos opened 10 months ago

decryptedchaos commented 10 months ago

This has already been brought up back in 2022 here #164 and #136

I found none of the discussed workarounds viaable.. I really wanted vaping to work as a simpler alternative to smokeping (rrdtool alignment sucks)

But after a day of messing with it and trying to pin library versions which debian gets mad at you for doing anyway.. i just could not get it to work with a resonable amount of effort.. i'd have to completely change all my python librarys to older/newer versions to work and thats just not resonable to me..

I would have hoped this would have been solved since 2022, but with that said this does seam to be a small team project so thats understandable..

Well there you go, i suggest this remain open or something opened in its place because this is still very much a big issue.

grizz commented 10 months ago

@decryptedchaos Sorry to hear you've had issues, both issues listed were different causes, but yeah, a blank graph is frustrating.

This is definitely overdue a dependencies update, which may fix your library issues. What libraries were causing problems?

Could you post your config and any error messages you got?

Thanks!

grizz commented 10 months ago

Just did an initial pass on updates with #174

grizz commented 10 months ago

Actually, it's looking like it might a js issue, could you check and see if you're getting a javascript error on the vaping page?

decryptedchaos commented 10 months ago

Sorry for the late response, GitHub isn't doing a good job of notifying me of responses, I will look into the pr tomorrow and get back to you it's late here

w4rum commented 9 months ago

I believe I have the same issue:

Screenshots ![image](https://github.com/20c/vaping/assets/1405498/dcb34dce-c792-4944-814e-9be2616b4666) ![image](https://github.com/20c/vaping/assets/1405498/af986840-1052-4121-886d-26f1b748340f)

I get the following error in the JS console:

Uncaught TypeError: this.d3.data.selectAll(...).data(...).enter is not a function
    render_data http://localhost:7021/static/graphsrv/js/graphsrv.js:1465
    render_dynamic http://localhost:7021/static/graphsrv/js/graphsrv.js:1356
    Base http://localhost:7021/static/graphsrv/js/graphsrv.js:869
    jQuery 2
        dispatch
        handle
[graphsrv.js:1465:10](http://localhost:7021/static/graphsrv/js/graphsrv.js)

image

Same issue on Firefox and Chrome.

decryptedchaos commented 9 months ago

Yea there were definitely JS errors like that, I just haven't had time to test it anymore I kinda got mad at it and removed it and I've been distro hopping lately so might test on this one soon

jamespo commented 8 months ago

I also get blank pages, in the console all I get are warnings like:

The script from “http://yourdomain.coml:7121/graph/?targets=all&id=auto-2&fit=yes&type=multitarget&config=multitarget&source=latency.distant” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.

These don't seem to be fatal though. This is in a virtualenv on debian 12 (python 3.11).

pppwaw commented 1 month ago

When blank, I got this response from api:

{"meta": {"error": "module 'inspect' has no attribute 'getargspec'"}, "data": []}

After search, I think that it comes from the 42 line of vodka/data/renderers.py:

class RPC(DataRenderer):

    """
    RPC renderer, renders an rpc response containing meta and data objects

    Should be used as a decorator. The decorated function will be called
    with the data container as first argument and the meta container referenced
    in the "meta" keyword argument.
    """

    def __init__(self, type="json", data_type=list, errors=False):
        super().__init__(type=type)
        self.errors = errors
        self.data_type = data_type

    def __call__(self, fn):
        def wrapped(*args, **kwargs):
            resp = {"meta": {}, "data": self.data_type()}
            try:
                i_args = inspect.getargspec(fn)
                if i_args.args and i_args.args[0] == "self":
                    fn(args[0], resp["data"], meta=resp["meta"], *args, **kwargs)
                else:
                    fn(resp["data"], meta=resp["meta"], *args, **kwargs)
            except Exception as inst:
                if self.errors:
                    resp["meta"]["error"] = str(inst)
                else:
                    raise
            return self.render(resp)

        wrapped.__name__ = fn.__name__
        return wrapped
pppwaw commented 1 month ago

I sent a PR to fix this: https://github.com/20c/vodka/pull/23