Git Product home page Git Product logo

inventree-shopify's People

Contributors

matmair avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

inventree-shopify's Issues

Plugin Install (No DB Table)

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...
^

Received a naive datetime

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/"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.