Frewacom / pywalfox

Dynamic theming of Firefox (and Thunderbird) using your Pywal colors
https://addons.mozilla.org/en-US/firefox/addon/pywalfox/
Mozilla Public License 2.0
583 stars 12 forks source link

Error: Native application tried to send a message of 1634038339 bytes, which exceeds the limit of 1048576 bytes #8

Closed Lau1406 closed 4 years ago

Lau1406 commented 4 years ago

Overview

I'm getting this error in the debug output of the Firefox plug-in itself and a couple of related errors, but I think they are caused by the original error, but I'll include them anyway. I have gone through the troubleshooting section in the README.md and everything there seems to be correct on my system.

Errors

Specs

Firefox 74 OS: Pop!_OS 19.10 python --version: 2.7.17 python3 --version: 3.7.5

Frewacom commented 4 years ago

Are you able to fetch and apply the colors using the Settings page?

Did you get the errors when you ran ./daemon/pywalfox.py with no arguments?

Lau1406 commented 4 years ago

When I click on 'Fetch pywal colors' in the plug-in nothing seems to happen. There are a couple of colors, but those seem to be default (black, white and red), definitely not the colors from pywal. When I run pywalfox.py without any arguments this is the output: Created UNIX socket Bound UNIX socket to /tmp/pywalfox_uds_socket And then I get a blinking cursor and no termination

Frewacom commented 4 years ago

The script runs in an infinite loop, so the output that you got indicates that everything is working. Have you restarted Firefox after running setup.sh?

Lau1406 commented 4 years ago

I hadn't at first, but now I have and nothing has changed. Is there a possibility that other plug-ins interfere somehow?

Frewacom commented 4 years ago

There should not be any interference, since all it does is set/override the theme.

Could you take a screenshot of the browser console right after starting Firefox? You could also take a look in the console of the Settings page as well to see if there are any errors.

Lau1406 commented 4 years ago

Screenshot from 2020-03-23 19-08-50 This is from the settings page of the plug-in. In other tabs there is no output

Frewacom commented 4 years ago

Could you take a screenshot of the Browser console on startup as well (Tools > Web developer > Browser console)?

Lau1406 commented 4 years ago

Screenshot from 2020-03-23 19-23-18 I didn't know this existed, nice to know =]

Lau1406 commented 4 years ago

Screenshot from 2020-03-23 19-27-32 This error appears there when I try to fetch the pywal colors in the plug-in

Frewacom commented 4 years ago

So it seems like the script is crashing when fetching the colors. How does the Browser console look like after you tried fetching the colors?

Lau1406 commented 4 years ago

No new messages appear after the ExtensionError: Native application tried to send a message of 1634038339 bytes, which exceeds the limit of 1048576 bytes. error message. No matter what buttons I click on the plug-in page. I could try and reinstall Firefox, maybe that there is a problem there

Frewacom commented 4 years ago

Try fetching the colors again and take a look in the Debugging output at the bottom of the Settings page.

Also, when you run python in you terminal, does it use version 2.7 or 3? I personally use 3, so it could be some version specific issue that only occurs when the addon tries fetching colors.

Lau1406 commented 4 years ago

I have reinstalled Firefox, including wiping of all user data before reinstalling. Good news is that the original error no longer shows in the debugging output. The bad news is that I now get the Unchecked lastError value: Error: Could not establish connection. Receiving end does not exist. error. I've seen that this is also in the README.md, but the path to the script is definitely correct (I can cat that exact path and the contents of the python file are displayed) and when I run the file manually (both with Python2 and Python3) it works and gets to the infinite loop

The default python is unfortunately python2

Frewacom commented 4 years ago

Very strange. I assume you tried fetching the colors with no success?

Also, what does env python return if you run it in your terminal?

Lau1406 commented 4 years ago
  1. Correct
  2. A python2 shell (version 2.7.17) I could set an alias to python3 from python and see if that changes things
Frewacom commented 4 years ago

Yes, try that. Honestly, setting up the native messaging can be a pain since the errors are quite diffuse. A lot of people have issues with it. Sorry for the inconvenience.

Lau1406 commented 4 years ago

No need to apologize, I'm already happy that someone decided to make this. And besides, I have to stay at home anyway because of covid-19. Anyway, I tried it and unfortunately after a firefox restart the original error is back again. I'll read myself a bit into that and see if I can figure something out

Frewacom commented 4 years ago

I believe that the issue is related to python 2.7.x and I will try to reproduce the issue myself and hopefully have a fix later tonight or tomorrow.

hegzploit commented 4 years ago

same error ^^

Frewacom commented 4 years ago

I am working on a fix. Seems like there is some issue with encoding the data when using Python 2.7 (despite using the exact same code from the Mozilla docs).

wts42 commented 4 years ago

Quick and dirty workaround if you have python3 on your machine: Change the shebang (first line of script Pywalfox/daemon/pywalfox.py) from

!/usr/bin/env python

to

!/usr/bin/env python3

Oh almost forgot, thanks Frewacom for your great work and thanks for posting it on unixporn.

Frewacom commented 4 years ago

I believe I have fixed this issue. Apparently, the issue was a print() used for debugging when setting up the UNIX-socket server.

4 hours well spent..

Lau1406 commented 4 years ago

Can confirm this fixes the issue. Thank you very much for fixing the bug

wts42 commented 4 years ago

Hey buddy,

Just pulled your current code which breaks it on my system. Again on changing the shebang to python3 fixes the issue.

Best regards

EDIT: But great work. I'm looking forward to more. :) (Github theme, Reddit theme, simple Theme Engine?)

Frewacom commented 4 years ago

God damn it. I tried running it with python2.7 and it all seemed to work fine.

Frewacom commented 4 years ago

I seem unable to reproduce your issue. Do you get the error on startup?

wts42 commented 4 years ago

Gimme a sec and I will try to reproduce. Any more info you need?

Frewacom commented 4 years ago

Not really. I just need to figure out when the error occurs.

wts42 commented 4 years ago

Odd, I changed back and now it runs like a charm. Changed nothing else. Sorry for the false alarm.

Frewacom commented 4 years ago

No problem. I am just glad I don't have to debug another issue like this.