invenhost / inventree-shopify Goto Github PK
View Code? Open in Web Editor NEWInvenTree plugin to link inventory with Shopify
License: MIT License
InvenTree plugin to link inventory with Shopify
License: MIT License
After adding inventree-shopify
to the plugins.txt file and restarting my containers docker-compose restart
i see the plugin appear and can enable it.
It appears the API keys etc all need to be added via the Admin Settings panel (under the Shopify Integration App section of the plugin menu these values are only shown as red asterisks).
When attempting to open the Webhook URL i get a server error and the error log is below indicating the tables don't exist.
Change Error
Error object (10)
[HISTORY](https://inventree.domain.com/admin/error_report/error/10/history/)
Type:
ProgrammingError
Path:
http://inventree.domain.com/plugin/shopify/webhook/
Info:
relation "inventree_shopify_shopifywebhook" does not exist
LINE 1: INSERT INTO "inventree_shopify_shopifywebhook" ("webhookendp...
^
When:
Aug. 4, 2023, 4:45 a.m.
Data:
Traceback (most recent call last):
File "/root/.local/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
psycopg2.errors.UndefinedTable: relation "inventree_shopify_shopifywebhook" does not exist
LINE 1: INSERT INTO "inventree_shopify_shopifywebhook" ("webhookendp...
^
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/root/.local/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.9/site-packages/inventree_shopify/ShopifyPlugin.py", line 173, in view_webhooks
'webhooks': self._webhook_check(request.get_host())
File "/usr/local/lib/python3.9/site-packages/inventree_shopify/ShopifyPlugin.py", line 206, in _webhook_check
self._webhook_create(host, topic)
File "/usr/local/lib/python3.9/site-packages/inventree_shopify/ShopifyPlugin.py", line 217, in _webhook_create
webhook = ShopifyWebhook.objects.create(name=f'{self.slug}_{topic}')
File "/root/.local/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/root/.local/lib/python3.9/site-packages/django/db/models/query.py", line 453, in create
obj.save(force_insert=True, using=self.db)
File "/root/.local/lib/python3.9/site-packages/django/db/models/base.py", line 739, in save
self.save_base(using=using, force_insert=force_insert,
File "/root/.local/lib/python3.9/site-packages/django/db/models/base.py", line 776, in save_base
updated = self._save_table(
File "/root/.local/lib/python3.9/site-packages/django/db/models/base.py", line 881, in _save_table
results = self._do_insert(cls._base_manager, using, fields, returning_fields, raw)
File "/root/.local/lib/python3.9/site-packages/django/db/models/base.py", line 919, in _do_insert
return manager._insert(
File "/root/.local/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
return getattr(self.get_queryset(), name)(*args, **kwargs)
File "/root/.local/lib/python3.9/site-packages/django/db/models/query.py", line 1270, in _insert
return query.get_compiler(using=using).execute_sql(returning_fields)
File "/root/.local/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1416, in execute_sql
cursor.execute(sql, params)
File "/root/.local/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute
return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File "/root/.local/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
return executor(sql, params, many, context)
File "/root/.local/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "/root/.local/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "/root/.local/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: relation "inventree_shopify_shopifywebhook" does not exist
LINE 1: INSERT INTO "inventree_shopify_shopifywebhook" ("webhookendp...
^
I spent some time trying to understand why my API key was not working but i believe that error message [API] Invalid API key or access token (unrecognized login or wrong password)
is not correct and is being sent after the failure to parse the date when attempting to create the webhook.
/root/.local/lib/python3.9/site-packages/django/db/models/fields/__init__.py:1358: RuntimeWarning: DateTimeField NotificationEntry.updated received a naive datetime (2023-08-17 00:00:00) while time zone support is active.
warnings.warn("DateTimeField %s.%s received a naive datetime "
Internal Server Error: /plugin/shopify/webhook/
Traceback (most recent call last):
File "/root/.local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
response = get_response(request)
File "/root/.local/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.9/site-packages/inventree_shopify/ShopifyPlugin.py", line 173, in view_webhooks
'webhooks': self._webhook_check(request.get_host())
File "/usr/local/lib/python3.9/site-packages/inventree_shopify/ShopifyPlugin.py", line 206, in _webhook_check
self._webhook_create(host, topic)
File "/usr/local/lib/python3.9/site-packages/inventree_shopify/ShopifyPlugin.py", line 228, in _webhook_create
raise KeyError(response)
KeyError: {'errors': '[API] Invalid API key or access token (unrecognized login or wrong password)'}
192.168.1.164 - - [18/Aug/2023:11:33:01 +0000] "GET /plugin/shopify/webhook/ HTTP/1.0" 500 18992 "http://192.168.1.10:3002/settings/"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.