frappe / frappe/ecommerce_integrations
Shopify Setting save fails due to invalid job_id
- Dominant language
- Python
- Stars
- 206
- Forks
- 275
- Avg merge
- 54m
- Merged PRs (30d)
- 1
Description
This is the following error i am getting when trying to sync old orders and import products from shopify, Note I have setup ERPNext and bench setup locally for development and also using ngrok for accessing erp theoigh https
### App Versions
```
{
"ecommerce_integrations": "1.17.0",
"erpnext": "15.104.3",
"frappe": "15.105.0"
}
```
### Route
```
shopify-import-products
```
### Traceback
```
Traceback (most recent call last):
File "apps/frappe/frappe/app.py", line 120, in application
response = frappe.api.handle(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/api/__init__.py", line 52, in handle
data = endpoint(**arguments)
^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/api/v1.py", line 40, in handle_rpc_call
return frappe.handler.handle()
^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/handler.py", line 53, in handle
data = execute_cmd(cmd)
^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/handler.py", line 86, in execute_cmd
return frappe.call(method, **frappe.form_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/__init__.py", line 1760, in call
return fn(*args, **newargs)
^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/utils/typing_validations.py", line 32, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "apps/ecommerce_integrations/ecommerce_integrations/shopify/page/shopify_import_products/shopify_import_products.py", line 121, in import_all_products
frappe.enqueue(
File "apps/frappe/frappe/__init__.py", line 2269, in enqueue
return frappe.utils.background_jobs.enqueue(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "apps/frappe/frappe/utils/background_jobs.py", line 172, in enqueue
return enqueue_call()
^^^^^^^^^^^^^^
File "apps/frappe/frappe/utils/background_jobs.py", line 156, in enqueue_call
return q.enqueue_call(
^^^^^^^^^^^^^^^
File "env/lib/python3.12/site-packages/rq/queue.py", line 729, in enqueue_call
job = self.create_job(
^^^^^^^^^^^^^^^^
File "env/lib/python3.12/site-packages/rq/queue.py", line 579, in create_job
job = self.job_class.create(
^^^^^^^^^^^^^^^^^^^^^^
File "env/lib/python3.12/site-packages/rq/job.py", line 319, in create
job.id = id
^^^^^^
File "env/lib/python3.12/site-packages/rq/job.py", line 764, in id
validate_job_id(value)
File "env/lib/python3.12/site-packages/rq/job.py", line 85, in validate_job_id
raise ValueError('Job ID must only contain letters, numbers, underscores and dashes')
ValueError: Job ID must only contain letters, numbers, underscores and dashes
```
### Request Data
```
{
"type": "POST",
"args": {},
"headers": {},
"error_handlers": {},
"url": "/api/method/ecommerce_integrations.shopify.page.shopify_import_products.shopify_import_products.import_all_products",
"request_id": null
}
```
### Response Data
```
{
"exception": "ValueError: Job ID must only contain letters, numbers, underscores and dashes",
"exc_type": "ValueError",
"_exc_source": "ecommerce_integrations (app)"
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start at ecommerce_integrations/shopify/page/shopify_import_products/shopify_import_products.py, especially import_all_products around line 121, and trace the frappe.enqueue call through the background-job path shown in the traceback. Reproduce the shopify-import-products request with the reported setup; done means importing products and syncing old orders no longer fails with the RQ job ID validation error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 45/100