Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
3725 มุมมอง

Does anybody get errors while executing update stock?  
- I am assuming that more than 20k SKU is causing the problem 

This is what I get errors details while executing updates for stock


/Traceback (most recent call last):
 File "/opt/odoo/odoo11/addons/shopify_ept/shopify/pyactiveresource/connection.py", line 286, in _open
    http_response = self._handle_error(self._urlopen(request))
 File "/opt/odoo/odoo11/addons/shopify_ept/shopify/pyactiveresource/connection.py", line 318, in _urlopen
   return urllib.request.urlopen(request)
 File "/opt/rh/rh-python35/root/usr/lib64/python3.5/urllib/request.py", line 162, in urlopen
   return opener.open(url, data, timeout)
 File "/opt/rh/rh-python35/root/usr/lib64/python3.5/urllib/request.py", line 471, in open
   response = meth(req, response)
 File "/opt/rh/rh-python35/root/usr/lib64/python3.5/urllib/request.py", line 581, in http_response
   'http', request, response, code, msg, hdrs)
 File "/opt/rh/rh-python35/root/usr/lib64/python3.5/urllib/request.py", line 509, in error
   return self._call_chain(*args)
 File "/opt/rh/rh-python35/root/usr/lib64/python3.5/urllib/request.py", line 443, in _call_chain
   result = func(*args)
 File "/opt/rh/rh-python35/root/usr/lib64/python3.5/urllib/request.py", line 589, in http_error_default
   raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 502: Bad Gateway

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 File "/opt/odoo/odoo11/addons/shopify_ept/models/shopify_product_ept.py", line 896, in update_stock_in_shopify
   int(quantity))
 File "/opt/odoo/odoo11/addons/shopify_ept/shopify/resources/inventory_level.py", line 47, in set
   resource = cls.post('set', body=json.dumps(body).encode())
 File "/opt/odoo/odoo11/addons/shopify_ept/shopify/pyactiveresource/activeresource.py", line 675, in _class_post
   return cls.connection.post(url, cls.headers, body)
 File "/opt/odoo/odoo11/addons/shopify_ept/shopify/pyactiveresource/connection.py", line 375, in post
   return self._open('POST', path, headers=headers, data=data)
 File "/opt/odoo/odoo11/addons/shopify_ept/shopify/base.py", line 26, in _open
   self.response = super(ShopifyConnection, self)._open(*args, **kwargs)
 File "/opt/odoo/odoo11/addons/shopify_ept/shopify/pyactiveresource/connection.py", line 288, in _open
   http_response = self._handle_error(err)
 File "/opt/odoo/odoo11/addons/shopify_ept/shopify/pyactiveresource/connection.py", line 429, in _handle_error
   raise ServerError(err)
odoo.addons.shopify_ept.shopify.pyactiveresource.connection.ServerError: Bad Gateway

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
 File "/opt/odoo/odoo11/odoo/http.py", line 651, in _handle_exception
   return super(JsonRequest, self)._handle_exception(exception)
 File "/opt/odoo/odoo11/odoo/http.py", line 310, in _handle_exception
   raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
 File "/opt/odoo/odoo11/odoo/tools/pycompat.py", line 87, in reraise
   raise value
 File "/opt/odoo/odoo11/odoo/http.py", line 693, in dispatch
   result = self._call_function(**self.params)
 File "/opt/odoo/odoo11/odoo/http.py", line 342, in _call_function
   return checked_call(self.db, *args, **kwargs)
 File "/opt/odoo/odoo11/odoo/service/model.py", line 97, in wrapper
   return f(dbname, *args, **kwargs)
 File "/opt/odoo/odoo11/odoo/http.py", line 335, in checked_call
   result = self.endpoint(*a, **kw)
 File "/opt/odoo/odoo11/odoo/http.py", line 937, in __call__
   return self.method(*args, **kw)
 File "/opt/odoo/odoo11/odoo/http.py", line 515, in response_wrap
   response = f(*args, **kw)
 File "/opt/odoo/odoo11/addons/web/controllers/main.py", line 938, in call_button
   action = self._call_kw(model, method, args, {})
 File "/opt/odoo/odoo11/addons/web/controllers/main.py", line 926, in _call_kw
   return call_kw(request.env[model], method, args, kwargs)
 File "/opt/odoo/odoo11/odoo/api.py", line 689, in call_kw
   return call_kw_multi(method, model, args, kwargs)
 File "/opt/odoo/odoo11/odoo/api.py", line 680, in call_kw_multi
   result = method(recs, *args, **kwargs)
 File "/opt/odoo/odoo11/addons/shopify_ept/wizard/shopify_process_import_export.py", line 90, in execute
   self.update_stock_in_shopify()
 File "/opt/odoo/odoo11/addons/shopify_ept/wizard/shopify_process_import_export.py", line 212, in update_stock_in_shopify
   products and shopify_product_tmpl_obj.update_stock_in_shopify(instance, products)
 File "/opt/odoo/odoo11/addons/shopify_ept/models/shopify_product_ept.py", line 898, in update_stock_in_shopify
   if e.response.code == 429 and e.response.msg == "Too Many Requests":
AttributeError: 'ServerError' object has no attribute 'response' Like4:39 pmMessage read today


I would be much appreciate if someone can help me with this.  

อวตาร
ละทิ้ง

I would suggest to ask the author of the module as it is a paid app and they will support such issues/errors.

คำตอบที่ดีที่สุด

Which connector do you use?

If you watch the video about this Odoo Shopify connector, you will see that it provides human readable errors that are easy to debug - https://youtu.be/6rQOjfzOuE0 

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Here, e as Exception and that got the value like string not response format from the request, so need to check first the e is not string then can check the e have the response or not.

e got like in string while any variable not defined in try: block, or something another error.

Also you can use to check Exception have response or not like, 

if hasattr(e, "response"):

    if e.response.code == 429 and e.response.msg == "Too Many Requests":



อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
มี.ค. 15
3269
1
ต.ค. 20
4074
0
มี.ค. 15
3553
0
พ.ย. 20
2539
1
พ.ค. 17
6227