Yowsup: AuthError: not-authorized

Created on 21 Jun 2016  路  17Comments  路  Source: tgalal/yowsup

I have this problem in my app:

yowsup.layers.auth.autherror.AuthError: not-authorized

I read a lot of this issue in #1387 but not is clear what is the definitive solution of it.
Can you tell me how to resolve it?

Most helpful comment

Probably we should include something like:

--- a/yowsup/common/constants.py
+++ b/yowsup/common/constants.py
@@ -25,5 +25,7 @@ class YowConstants:

     PATH_STORAGE = "~/.yowsup"

+    AXOLOTL_DB = "axolotl.db"
+
     PREVIEW_WIDTH = 64
     PREVIEW_HEIGHT = 64
diff --git a/yowsup/common/tools.py b/yowsup/common/tools.py
index e2a2f63..c91c086 100644
--- a/yowsup/common/tools.py
+++ b/yowsup/common/tools.py
@@ -93,6 +93,17 @@ class StorageTools:
                 out = idFile.read()
         return out

+    @staticmethod
+    def removeAxolotlDB(phone):
+        path = StorageTools.getStorageForPhone(phone)
+        axolotlPath = os.path.join(path, YowConstants.AXOLOTL_DB)
+        if os.path.isfile(axolotlPath):
+            try:
+                os.remove(axolotlPath)
+            except Exception as e:
+                logger.error(e.message)
+
+
 class TimeTools:
     @staticmethod
     def parseIso(iso):
diff --git a/yowsup/layers/axolotl/layer.py b/yowsup/layers/axolotl/layer.py
index a5721ea..6608e5a 100644
--- a/yowsup/layers/axolotl/layer.py
+++ b/yowsup/layers/axolotl/layer.py
@@ -46,7 +46,7 @@ class YowAxolotlLayer(YowProtocolLayer):
     _STATE_GENKEYS = 1
     _STATE_HASKEYS = 2
     _COUNT_PREKEYS = 200
-    _DB = "axolotl.db"
+    _DB = YowConstants.AXOLOTL_DB

     def __init__(self):
         super(YowAxolotlLayer, self).__init__()
diff --git a/yowsup/registration/regrequest.py b/yowsup/registration/regrequest.py
index f65b0a1..d03d0a1 100644
--- a/yowsup/registration/regrequest.py
+++ b/yowsup/registration/regrequest.py
@@ -63,5 +63,8 @@ class WARegRequest(WARequest):

         self.setParser(JSONResponseParser())

+        if self.status == 'ok':
+            StorageTools.removeAxolotlDB(cc + p_in)
+
     def register(self):
         return self.send()

To be sure about axolotl.db cleaning after registering. Could someone test it? Currently I have no time for that.

All 17 comments

It means your number is blocked

Is the number and IP blocked?
Can I try another number in the same server?

only the number. I can register another on the server.
delete the file: axolotl.db
~/.yowsup/"Your number"/

I have the same Issues, any idea??

One week ago my number was also blocked.
I wrote to whatsapp support and asked for unblocking, but they didn't unblock.
So I put SIM card into mobile and used official app to register.
Same problem: phone number blocked.
I hit support button in app, mail app starts with whatsapp log files attached.
I asked for unblocking and one day later my phone number was unblocked.

@Messiefee
blocking occurs because the same number with different versions of yowsup or other servers are used.
if they will change version or will include changes in yowsup, delete the axolotl.db file before execute again yowsup.

besides this, try not to send more than 50 messages unanswered.

WhatsApp policies clearly that blocked number is detected as an automated system indicate.
recommended would be a bot, with question and answer.

@sowerkoku Me where can I find this doc axolotl.db

@Messiefee look up

Probably we should include something like:

--- a/yowsup/common/constants.py
+++ b/yowsup/common/constants.py
@@ -25,5 +25,7 @@ class YowConstants:

     PATH_STORAGE = "~/.yowsup"

+    AXOLOTL_DB = "axolotl.db"
+
     PREVIEW_WIDTH = 64
     PREVIEW_HEIGHT = 64
diff --git a/yowsup/common/tools.py b/yowsup/common/tools.py
index e2a2f63..c91c086 100644
--- a/yowsup/common/tools.py
+++ b/yowsup/common/tools.py
@@ -93,6 +93,17 @@ class StorageTools:
                 out = idFile.read()
         return out

+    @staticmethod
+    def removeAxolotlDB(phone):
+        path = StorageTools.getStorageForPhone(phone)
+        axolotlPath = os.path.join(path, YowConstants.AXOLOTL_DB)
+        if os.path.isfile(axolotlPath):
+            try:
+                os.remove(axolotlPath)
+            except Exception as e:
+                logger.error(e.message)
+
+
 class TimeTools:
     @staticmethod
     def parseIso(iso):
diff --git a/yowsup/layers/axolotl/layer.py b/yowsup/layers/axolotl/layer.py
index a5721ea..6608e5a 100644
--- a/yowsup/layers/axolotl/layer.py
+++ b/yowsup/layers/axolotl/layer.py
@@ -46,7 +46,7 @@ class YowAxolotlLayer(YowProtocolLayer):
     _STATE_GENKEYS = 1
     _STATE_HASKEYS = 2
     _COUNT_PREKEYS = 200
-    _DB = "axolotl.db"
+    _DB = YowConstants.AXOLOTL_DB

     def __init__(self):
         super(YowAxolotlLayer, self).__init__()
diff --git a/yowsup/registration/regrequest.py b/yowsup/registration/regrequest.py
index f65b0a1..d03d0a1 100644
--- a/yowsup/registration/regrequest.py
+++ b/yowsup/registration/regrequest.py
@@ -63,5 +63,8 @@ class WARegRequest(WARequest):

         self.setParser(JSONResponseParser())

+        if self.status == 'ok':
+            StorageTools.removeAxolotlDB(cc + p_in)
+
     def register(self):
         return self.send()

To be sure about axolotl.db cleaning after registering. Could someone test it? Currently I have no time for that.

Tnx men @jlguardi I try to do,.

Whatsapp has blocked all the numbers i was using to communicate via whatsapp. Most of the numbers worked fine for nearly one year.

Even updating to the recent environment did not solve the problem. Whatsapp blocks newly registered numbers within 24h or so.

Has anyone of you faced this problem recently?

@janboll please read here.

@janboll Same here too. I had 2 numbers blocked in quick succession and I wasnt even doing any monkey business.

I had 14 blocked numbers. but I have two months working well with yowsup

Is there any way to return one use a number , blocked by using " Yowsup "???

I am working on yowsup from last few weeks.

and I've got blocked my all phone numbers.

From the pattern they block I think they block only numbers who send approx 50+ messages within 1 min. to 50 different contacts.

BUT

They don't block any number if you have synced those contacts 1-2 days before sending them messages.

This trick is working for me from last week .

Also If those Contacts are replying, then we have less chance to get blocked.

Was this page helpful?
0 / 5 - 0 ratings