mukulhase / WebWhatsapp-Wrapper

An API for sending and receiving messages over web.whatsapp [Working as of 18th May 2018]
https://webwhatsapi.readthedocs.io/en/latest/
MIT License
2.02k stars 797 forks source link

Running on docker: TypeError: 'NoneType' object is not iterable #1005

Closed efjcz closed 3 years ago

efjcz commented 3 years ago

Hi, I just installed and tried to run and got this error, check some logs:

`root@python-docker:/home/WebWhatsapp-Wrapper# docker ls docker: 'ls' is not a docker command. See 'docker --help' root@python-docker:/home/WebWhatsapp-Wrapper# docker network ls NETWORK ID NAME DRIVER SCOPE 44ae91a33dbd bridge bridge local 4594912907d8 host host local 3912eb0b52e4 none null local 9c61ef4f1a7e selenium bridge local root@python-docker:/home/WebWhatsapp-Wrapper# root@python-docker:/home/WebWhatsapp-Wrapper# root@python-docker:/home/WebWhatsapp-Wrapper# docker run --network selenium -it -e SELENIUM='http://firefox:4444/wd/hub' -v $(pwd):/app webwhatsapi /bin/bash -c "pip install ./;pip list;python sample/remote.py"^C root@python-docker:/home/WebWhatsapp-Wrapper# ls -l total 80 -rw-r--r-- 1 root root 348 Feb 25 01:54 Dockerfile -rw-r--r-- 1 root root 1200 Feb 25 01:54 ISSUE_TEMPLATE.md -rw-r--r-- 1 root root 1081 Feb 25 01:54 LICENSE.txt -rw-r--r-- 1 root root 32 Feb 25 01:54 MANIFEST.in -rw-r--r-- 1 root root 2041 Feb 25 01:54 Makefile -rw-r--r-- 1 root root 7158 Feb 25 01:54 README.md -rw-r--r-- 1 root root 486 Feb 25 01:54 docker-compose.yml -rwxr-xr-x 1 root root 69 Feb 25 01:54 docker-entrypoint.sh drwxr-xr-x 3 root root 4096 Feb 25 01:54 docs -rw-r--r-- 1 root root 0 Feb 25 01:58 geckodriver.log -rw-r--r-- 1 root root 8712 Feb 25 01:54 pylint.rc drwxr-xr-x 2 root root 4096 Feb 25 01:54 requirements -rw-r--r-- 1 root root 24 Feb 25 01:54 requirements.txt drwxr-xr-x 3 root root 4096 Feb 25 01:54 sample -rw-r--r-- 1 root root 3424 Feb 25 01:54 setup.py -rw-r--r-- 1 root root 847 Feb 25 01:54 tox.ini drwxr-xr-x 2 root root 4096 Feb 25 01:54 utils drwxr-xr-x 5 root root 4096 Feb 25 01:58 webwhatsapi root@python-docker:/home/WebWhatsapp-Wrapper# docker run --network selenium -it -e SELENIUM='http://firefox:4444/wd/hub' -v $(pwd):/app webwhatsapi /bin/bash -c "pip install ./;pip list;python sample/remote.py" Processing /app Requirement already satisfied: python-dateutil>=2.6.0 in /usr/local/lib/python3.8/site-packages (from webwhatsapi==2.0.3) (2.8.1) Requirement already satisfied: selenium>=3.4.3 in /usr/local/lib/python3.8/site-packages (from webwhatsapi==2.0.3) (3.141.0) Requirement already satisfied: six>=1.10.0 in /usr/local/lib/python3.8/site-packages (from webwhatsapi==2.0.3) (1.15.0) Requirement already satisfied: python-axolotl in /usr/local/lib/python3.8/site-packages (from webwhatsapi==2.0.3) (0.2.3) Requirement already satisfied: cryptography in /usr/local/lib/python3.8/site-packages (from webwhatsapi==2.0.3) (3.4.6) Requirement already satisfied: python-magic in /usr/local/lib/python3.8/site-packages (from webwhatsapi==2.0.3) (0.4.22) Requirement already satisfied: urllib3 in /usr/local/lib/python3.8/site-packages (from selenium>=3.4.3->webwhatsapi==2.0.3) (1.26.3) Requirement already satisfied: cffi>=1.12 in /usr/local/lib/python3.8/site-packages (from cryptography->webwhatsapi==2.0.3) (1.14.5) Requirement already satisfied: pycparser in /usr/local/lib/python3.8/site-packages (from cffi>=1.12->cryptography->webwhatsapi==2.0.3) (2.20) Requirement already satisfied: python-axolotl-curve25519>=0.4.1 in /usr/local/lib/python3.8/site-packages (from python-axolotl->webwhatsapi==2.0.3) (0.4.1.post2) Requirement already satisfied: protobuf>=3.0.0.b2 in /usr/local/lib/python3.8/site-packages (from python-axolotl->webwhatsapi==2.0.3) (3.15.2) Building wheels for collected packages: webwhatsapi Building wheel for webwhatsapi (setup.py) ... done Created wheel for webwhatsapi: filename=webwhatsapi-2.0.3-py3-none-any.whl size=58831 sha256=e4c5bcd17a398a0134eb384fc987a40ff61525742f58cfcc142fc8c83f610e92 Stored in directory: /tmp/pip-ephem-wheel-cache-1eoqjero/wheels/40/5d/89/f38b7a58cbc6f6bdff423c409ca06a097d4abae527d8c17f06 Successfully built webwhatsapi Installing collected packages: webwhatsapi Successfully installed webwhatsapi-2.0.3 Package Version


certifi 2020.12.5 cffi 1.14.5 chardet 4.0.0 cryptography 3.4.6 idna 2.10 numpy 1.20.1 Pillow 8.1.0 pip 21.0.1 protobuf 3.15.2 pycparser 2.20 python-axolotl 0.2.3 python-axolotl-curve25519 0.4.1.post2 python-dateutil 2.8.1 python-magic 0.4.22 python-resize-image 1.1.19 requests 2.25.1 selenium 3.141.0 setuptools 53.0.0 six 1.15.0 typing 3.7.4.3 urllib3 1.26.3 webwhatsapi 2.0.3 wheel 0.36.2 Environment environ({'HOSTNAME': 'a7becd3bbfd9', 'PYTHON_VERSION': '3.8.8', 'PWD': '/app', 'SELENIUM': 'http://firefox:4444/wd/hub', 'HOME': '/root', 'LANG': 'C.UTF-8', 'GPG_KEY': 'E3FF2839C048B25C084DEBE9B26995E310250568', 'TERM': 'xterm', 'SHLVL': '1', 'PYTHON_PIP_VERSION': '21.0.1', 'PYTHON_GET_PIP_SHA256': 'c3b81e5d06371e135fb3156dc7d8fd6270735088428c4a9a5ec1f342e2024565', 'PYTHON_GET_PIPURL': 'https://github.com/pypa/get-pip/raw/b60e2320d9e8d02348525bd74e871e466afdf77c/get-pip.py', 'PATH': '/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin', '': '/usr/local/bin/python'}) Waiting for QR Saving session Bot started Checking for more messages, status NotLoggedIn Traceback (most recent call last): File "sample/remote.py", line 35, in for contact in driver.get_unread(): File "/usr/local/lib/python3.8/site-packages/webwhatsapi/init.py", line 416, in get_unread raw_message_groups = self.wapi_functions.getUnreadMessages( File "/usr/local/lib/python3.8/site-packages/webwhatsapi/wapi_js_wrapper.py", line 44, in getattr wapi_functions = dir(self) TypeError: 'NoneType' object is not iterable root@python-docker:/home/WebWhatsapp-Wrapper# `

any idea why it happened?

efjcz commented 3 years ago

found it

it happens when english is not the default laguage of your phone

RabiRoshan commented 3 years ago

Hi @efjcz , I am facing this issue. My phone's default language is English (United States). Can you please explain how exactly did you fix it?