Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

product.save() doesn't appear to be working #731

Closed
cmogush opened this issue Jul 22, 2024 · 3 comments
Closed

product.save() doesn't appear to be working #731

cmogush opened this issue Jul 22, 2024 · 3 comments
Labels

Comments

@cmogush
Copy link

cmogush commented Jul 22, 2024

Issue summary

Write a short description of the issue here ↓
product.save() doesn't seem to be saving the product

Expected behavior

A newly created product, or existing product with modifications, should save when call the product.save() method

Actual behavior

When called on a new product, nothing happens.
When called on an existing product, an error is thrown

pyactiveresource.connection.Redirection: Response(code=301, body="b''", headers={'Date': 'Fri, 19 Jul 2024 18:39:19 GMT', 'Content-Type': 'text/html; charset=utf-8', 'Transfer-Encoding': 'chunked', 'Connection': 'close', 'X-Sorting-Hat-PodId': '294', 'X-Sorting-Hat-ShopId': '80191488295', 'referrer-policy': 'origin-when-cross-origin', 'x-frame-options': 'DENY', 'x-shopid': '80191488295', 'x-shardid': '294', 'location': 'https://711923-2.myshopify.com/admin/api/2022-07/products/9468056895783.json', 'strict-transport-security': 'max-age=7889238', 'set-cookie': 'request_method=PUT; path=/; SameSite=Lax', 'x-request-id': 'e8adfc04-1fbe-471e-b8c6-4ff2ba5c18b1-1721414359', 'server-timing': 'processing;dur=34, socket_queue;dur=3.042, edge;dur=2.045, util;dur=0.111, memcache;dur=6.135, redis;dur=0.0, db;dur=1.712, elasticsearch;dur=0.0, view;dur=0.0, externals;dur=7.847, graphql_lex;desc="GraphQL Lexing";dur=0.0, graphql_parse;desc="GraphQL Parsing";dur=0.0, graphql_execute;desc="GraphQL Execution";dur=0.0, graphql_analyze;desc="GraphQL Analysis";dur=0.0, graphql_validate;desc="GraphQL Static Validation";dur=0.0', 'server-timing-public': 'processing;dur=34', 'content-security-policy': "default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://* shopify-pos://*; block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self' wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob: https:; script-src https://cdn.shopify.com/ https://cdn.shopifycdn.net/ https://checkout.shopifycs.com/ https://api.stripe.com/ https://mpsnare.iesnare.com/ https://appcenter.intuit.com/ https://www.paypal.com/ https://js.braintreegateway.com/ https://c.paypal.com/ https://maps.googleapis.com/ https://www.google-analytics.com/ https://v.shopify.com/ 'self' 'unsafe-inline' 'unsafe-eval'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=update&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fproducts&source%5Bsection%5D=admin_api&source%5Buuid%5D=e8adfc04-1fbe-471e-b8c6-4ff2ba5c18b1-1721414359", 'x-content-type-options': 'nosniff', 'x-download-options': 'noopen', 'x-permitted-cross-domain-policies': 'none', 'x-xss-protection': '1; mode=block; report=/xss-report?source%5Baction%5D=update&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fproducts&source%5Bsection%5D=admin_api&source%5Buuid%5D=e8adfc04-1fbe-471e-b8c6-4ff2ba5c18b1-1721414359', 'x-dc': 'gcp-us-east4,gcp-us-central1,gcp-us-central1', 'CF-Cache-Status': 'DYNAMIC', 'Report-To': '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v4?s=M5sw4C2u34o7gMg2tcbhAchfWcXCP0L0gTnCTh0oNkiz81%2FvFot8koSMcY%2FWrtxCSa5%2FMECPo3vKTaVGkOZp9bnD4RhnuOCmxNNIuxZf1s8N9qu3rrArnFbjgbiSu5q5Jx0vRn5KuKwytvC5K%2BU%3D"}],"group":"cf-nel","max_age":604800}', 'NEL': '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}', 'Server-Timing': 'processing;dur=34, socket_queue;dur=3.042, edge;dur=2.045, util;dur=0.111, memcache;dur=6.135, redis;dur=0.0, db;dur=1.712, elasticsearch;dur=0.0, view;dur=0.0, externals;dur=7.847, graphql_lex;desc="GraphQL Lexing";dur=0.0, graphql_parse;desc="GraphQL Parsing";dur=0.0, graphql_execute;desc="GraphQL Execution";dur=0.0, graphql_analyze;desc="GraphQL Analysis";dur=0.0, graphql_validate;desc="GraphQL Static Validation";dur=0.0', 'Server': 'cloudflare', 'CF-RAY': '8a5cd56108731438-PIT', 'alt-svc': 'h3=":443"; ma=86400'}, msg="Moved Permanently")

Steps to reproduce the problem

For new product

  1. session = startShopifySession()

product = shopify.Product()
product.title = "Test Product"
product.save()
2. Check the inventory and there are no new products seen.

For existing product

  1. session = startShopifySession()

product = shopify.Product.find(9468056895783)
product.price = "9.99"
product.save()

2. receive the error message:
pyactiveresource.connection.Redirection: Response(code=301, body="b''", headers={'Date': 'Fri, 19 Jul 2024 18:39:19 GMT', 'Content-Type': 'text/html; charset=utf-8', 'Transfer-Encoding': 'chunked', 'Connection': 'close', 'X-Sorting-Hat-PodId': '294', 'X-Sorting-Hat-ShopId': '80191488295', 'referrer-policy': 'origin-when-cross-origin', 'x-frame-options': 'DENY', 'x-shopid': '80191488295', 'x-shardid': '294', 'location': 'https://711923-2.myshopify.com/admin/api/2022-07/products/9468056895783.json', 'strict-transport-security': 'max-age=7889238', 'set-cookie': 'request_method=PUT; path=/; SameSite=Lax', 'x-request-id': 'e8adfc04-1fbe-471e-b8c6-4ff2ba5c18b1-1721414359', 'server-timing': 'processing;dur=34, socket_queue;dur=3.042, edge;dur=2.045, util;dur=0.111, memcache;dur=6.135, redis;dur=0.0, db;dur=1.712, elasticsearch;dur=0.0, view;dur=0.0, externals;dur=7.847, graphql_lex;desc="GraphQL Lexing";dur=0.0, graphql_parse;desc="GraphQL Parsing";dur=0.0, graphql_execute;desc="GraphQL Execution";dur=0.0, graphql_analyze;desc="GraphQL Analysis";dur=0.0, graphql_validate;desc="GraphQL Static Validation";dur=0.0', 'server-timing-public': 'processing;dur=34', 'content-security-policy': "default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://* shopify-pos://*; block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self' wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob: https:; script-src https://cdn.shopify.com/ https://cdn.shopifycdn.net/ https://checkout.shopifycs.com/ https://api.stripe.com/ https://mpsnare.iesnare.com/ https://appcenter.intuit.com/ https://www.paypal.com/ https://js.braintreegateway.com/ https://c.paypal.com/ https://maps.googleapis.com/ https://www.google-analytics.com/ https://v.shopify.com/ 'self' 'unsafe-inline' 'unsafe-eval'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=update&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fproducts&source%5Bsection%5D=admin_api&source%5Buuid%5D=e8adfc04-1fbe-471e-b8c6-4ff2ba5c18b1-1721414359", 'x-content-type-options': 'nosniff', 'x-download-options': 'noopen', 'x-permitted-cross-domain-policies': 'none', 'x-xss-protection': '1; mode=block; report=/xss-report?source%5Baction%5D=update&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fproducts&source%5Bsection%5D=admin_api&source%5Buuid%5D=e8adfc04-1fbe-471e-b8c6-4ff2ba5c18b1-1721414359', 'x-dc': 'gcp-us-east4,gcp-us-central1,gcp-us-central1', 'CF-Cache-Status': 'DYNAMIC', 'Report-To': '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v4?s=M5sw4C2u34o7gMg2tcbhAchfWcXCP0L0gTnCTh0oNkiz81%2FvFot8koSMcY%2FWrtxCSa5%2FMECPo3vKTaVGkOZp9bnD4RhnuOCmxNNIuxZf1s8N9qu3rrArnFbjgbiSu5q5Jx0vRn5KuKwytvC5K%2BU%3D"}],"group":"cf-nel","max_age":604800}', 'NEL': '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}', 'Server-Timing': 'processing;dur=34, socket_queue;dur=3.042, edge;dur=2.045, util;dur=0.111, memcache;dur=6.135, redis;dur=0.0, db;dur=1.712, elasticsearch;dur=0.0, view;dur=0.0, externals;dur=7.847, graphql_lex;desc="GraphQL Lexing";dur=0.0, graphql_parse;desc="GraphQL Parsing";dur=0.0, graphql_execute;desc="GraphQL Execution";dur=0.0, graphql_analyze;desc="GraphQL Analysis";dur=0.0, graphql_validate;desc="GraphQL Static Validation";dur=0.0', 'Server': 'cloudflare', 'CF-RAY': '8a5cd56108731438-PIT', 'alt-svc': 'h3=":443"; ma=86400'}, msg="Moved Permanently")

I realize I am new to this, and I apologize if this isn't an actual bug but maybe I'm doing something wrong. I tried to find supporting documentation and scoured this Git, Google, Shopify developer help boards, and even made several posting there, but still cannot solve this issue. If there is a better resource or place to assist with this, I'll gladly check elsewhere. Any help or guidance pointing me in the right direction is greatly appreciated. Thank you!

@sillycube
Copy link

The /products and /variants endpoints are deprecated:
https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model#whats-changing

Copy link

github-actions bot commented Oct 2, 2024

This issue is stale because it has been open for 60 days with no activity. It will be closed if no further action occurs in 14 days.

@github-actions github-actions bot added the Stale label Oct 2, 2024
Copy link

We are closing this issue because it has been inactive for a few months.
This probably means that it is not reproducible or it has been fixed in a newer version.
If it’s an enhancement and hasn’t been taken on since it was submitted, then it seems other issues have taken priority.

If you still encounter this issue with the latest stable version, please reopen using the issue template. You can also contribute directly by submitting a pull request– see the CONTRIBUTING.md file for guidelines

Thank you!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants