-
-
Notifications
You must be signed in to change notification settings - Fork 574
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
watcher afk / windows behind proxy (squid) #266
Comments
Ah, good point. I used to have that same issue but was able to circumvent it with a small tweak as you can see in this stackoverflow post. I have only tried that quick solution on Linux though, but I assume that it works on windows as well. https://stackoverflow.com/a/8287752/2127148 In the long run we should probably add a option to set proxy in the aw-client.ini configuration file in aw-client as that would be a simpler fix. |
@OlivierMary Try to set them in lower-case as well |
@johan-bjareholt On windows env var are case insensitive..., but in code if you search it with case sensitive maybe... will try ! |
That error is different so something makes the code go a different path from your initial report at least. An error occurs while an error is occuring, there's clearly badly written code there which needs to be fixed. So this code is not the root of the problem, but it needs to be fixed to understand what the root of the problem is. @ErikBjare If I understand this correctly, we should handle the exception json.decoder.JSONDecodeError instead of json.JSONDecodeError. |
I think that last error is probably due to the proxy returning something that's not JSON, and it seems to me the exception is handled correctly. The documentation states it's called I've recently rewritten that code anyway, and this issue is mostly a curiosity and does not seem to be an actual issue with ActivityWatch, so closing. |
How to properly use ActivityWatch with a proxy is not clear though, so I'll re-open this issue until we create a new issue where we describe that we need to document it and possibly also add a configuration in aw-client.ini for it. |
@johan-bjareholt Why not just use an SSH tunnel? Works fine. Using it with a proxy is probably not at all secure so we shouldn't put any effort into supporting it anyway. Edit: Using squid as a proxy to localhost seems to need special configuration anyway: https://stackoverflow.com/questions/33169382/allow-access-to-localhost-from-localhost-by-squid |
We cannot all use ssh tunnel ... The problem is the watcher don't use correctly proxy or internet configuration. And why ? Actually it's only in localhost.... Just one try 127.0.0.1 and another localhost to connect to server. Maybe need to have a common configuration between server / watchers / client GUI. Will be hard if we have to configure proxy or other thing on all watcher / client ... Boring for users.... And when server will be online... A common configuration will be great !
|
I use already squid + corkscrew. But if I can't put the proxy conf in worker that cant be ok..
|
Proxy configuration should just work if you've declared the
I'm really having difficulty understanding what you're trying to say here. As far as I can tell it is using the proxy configuration correctly, otherwise you wouldn't get the This question on SO also suggests it could be a consequence of a proxy configuration issue: https://superuser.com/questions/124897/503-service-unavailable-what-really-it-means What I don't get is why you'd need a proxy for something that runs locally in the first place? Using ActivityWatch with a proxy should never be needed (unless you're trying to run the server on a different machine, which is highly unsecure and therefore not supported). Maybe you could try and reset the environment variables specifically for ActivityWatch so it doesn't use the proxy? |
@johan-bjareholt I really don't see why you reopened the issue. The |
If it's a issue with Squid not liking the use of You could also try setting the environment variable |
Ok, will try that next week not at work this week... Http_proxy is ok. No_proxy maybe. Will check that.
|
I'm proposing to document how to make activitywatch avoid using the system-default proxy.
We should have this note in our documentation, people shouldn't have to dig through the request library documentation to find a solution. Also, some people don't know how to set ENV vars, so it might also be a good idea to add a option to aw-client.ini which can override the default system proxy as that will simplify things a lot. |
This is a very common practice for configuring a proxy, and not the issue here, rather the cause of the problem.
If anything, we should configure aw-client to ignore proxies from env variables altogether (at least if the address of the server is |
I made an issue for aw-client here, let's discuss the rest there and I'll close this issue.
That might be a good idea, but for now I added a notice in the docs. If that solution solves it nicely we can remove this notice. |
@OlivierMary Something is probably wrong with your aw-client configuration, causing the two watchers that use it to fail. Check the logs. |
Hi,
Already check no error...
Just persistent DB in queues directory are very huge 100mb for one...
|
Then they are probably in the process of emptying... Could take a while. Check the raw data tab to see if any new events arrive to the buckets. |
@ErikBjare Yes maybe that, Windows is ok now just AFK no new event count... but a very long AFK timer is growing.... will see. DB size didn't grow down. |
It is also a known bug that consuming the queue is much slower on windows than on macOS/Linux. The pre-merge events a few releases ago should have improved this a bit, but if the queue has days of events it might still take hours to be fully worked through. Exactly why it's so slow on windows though I don't know. |
All is good now, that take 4-5h to consume ~1 month. |
Describe the bug
With my personal PC no problem, but at work with proxy for afk and windows watcher I have this error:
no problem with firefox plugin or other plugins
To Reproduce
Steps to reproduce the behavior:
Expected behavior
No bug
Environment
The text was updated successfully, but these errors were encountered: