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

Post fails to update after pushing to eBay #25

Closed
that1guy opened this issue Mar 31, 2015 · 10 comments
Closed

Post fails to update after pushing to eBay #25

that1guy opened this issue Mar 31, 2015 · 10 comments
Assignees

Comments

@that1guy
Copy link
Member

Item is still pushed to eBay. But the eBay callback data seems to not be stored in db because posting couldn't be updated.

Up-to-date with most recent develop branch. Hopefully this is helpful!

16:42:03.119Z TRACE posting-api: assigning ID 0e90cf08980c493c9bfb3c1bad69dc77 to posting
        16:42:03.120Z TRACE posting-api: setting default expiration of 14 days for posting
        16:42:03.121Z TRACE posting-api: posting is set to expire on Tue Apr 14 2015 09:42:03 GMT-0700 (PDT)
        16:42:03.123Z TRACE posting-api: creating new posting with postingId 0e90cf08980c493c9bfb3c1bad69dc77
        16:42:03.144Z TRACE posting-api: create posting 0e90cf08980c493c9bfb3c1bad69dc77 completed in 25 milliseconds
        16:42:07.074Z  INFO posting-api: POST /v1/postings/0e90cf08980c493c9bfb3c1bad69dc77/publish
        16:42:07.078Z TRACE posting-api: find posting by ID completed in 3 milliseconds
        16:42:07.083Z TRACE posting-api: no Ebay category match found for code SELE
        16:42:08.824Z TRACE posting-api: request to create fixed price post with eBay completed in 1740 milliseconds
        16:42:08.835Z TRACE posting-api: attempt to create eBay posting completed in 1760 milliseconds
        16:42:08.840Z TRACE posting-api: find posting by ID completed in 4 milliseconds
        16:42:08.845Z TRACE posting-api: updating existing posting with postingId 0e90cf08980c493c9bfb3c1bad69dc77
        16:42:08.873Z ERROR posting-api: 500: POST /v1/postings/0e90cf08980c493c9bfb3c1bad69dc77/publish
        16:42:08.874Z ERROR posting-api: unable to update posting by id
        err: {
          "name": "PersistenceError",
          "message": "unable to update posting by id",
          "sourceError": {
            "jse_shortmsg": "save of posting 0e90cf08980c493c9bfb3c1bad69dc77 failed",
            "jse_summary": "save of posting 0e90cf08980c493c9bfb3c1bad69dc77 failed: cannot use the part (ebay of ebay.endTime) to traverse the element ({ebay: null})",
            "jse_cause": {
              "name": "MongoError",
              "code": 16837,
              "err": "cannot use the part (ebay of ebay.endTime) to traverse the element ({ebay: null})"
            },
            "message": "save of posting 0e90cf08980c493c9bfb3c1bad69dc77 failed: cannot use the part (ebay of ebay.endTime) to traverse the element ({ebay: null})"
          },
          "statusCode": 500,
          "postingId": "0e90cf08980c493c9bfb3c1bad69dc77"
        }

@brozeph
Copy link
Contributor

brozeph commented Apr 6, 2015

I just noticed something - for an update, the PUT HTTP verb should be used and not POST... there appears to be a bug in that POST would actually let a client do that. This would, in theory, result in multiple (duplicate) postings in the API if POST was allowed this way.

@that1guy
Copy link
Member Author

that1guy commented Apr 7, 2015

You added the question label to this -- are you asking me something? Cause if you are I have no idea.. :) Also, would like to have this working by Wednesday at latest since I'm pitching that evening to a few Angel investors.

@that1guy
Copy link
Member Author

that1guy commented Apr 9, 2015

Josh, can we get this fixed before 6p? I'm pitching product tonight to a few interested angle investors. Thanks for help!

@brozeph
Copy link
Contributor

brozeph commented Apr 9, 2015

I'll shift to explore this now - have you updated the UI code to make PUT request instead of POST?

@that1guy
Copy link
Member Author

that1guy commented Apr 9, 2015

Oh, no. Is that this issue? Sorry I may have misunderstood. Checking.

HashtagSell.com
p: 415.294.1981
e: brad.davis@hashtagsell.com

On Thu, Apr 9, 2015 at 12:46 PM, Joshua Thomas notifications@github.com
wrote:

I'll shift to explore this now - have you updated the UI code to make PUT
request instead of POST?


Reply to this email directly or view it on GitHub
#25 (comment)
.

@that1guy
Copy link
Member Author

that1guy commented Apr 9, 2015

Here's the object I get back from posting API before pushing to ebay.

{
  "username": "jeanjean",
  "heading": "macbook air",
  "body": "<span class=\"mention-highlighter\" contenteditable=\"false\">#macbook air</span>&nbsp;for <span class=\"mention-highlighter-price\" contenteditable=\"false\">$40</span>&nbsp;<span class=\"mention-highlighter\" contenteditable=\"false\">@San Francisco, CA, United States</span>&nbsp;",
  "expiresAt": "2015-04-23T20:15:39.026Z",
  "categoryCode": "SELE",
  "annotations": [
    {
      "value": null,
      "key": "Year"
    },
    {
      "value": null,
      "key": "Hard Drive (Gb)"
    },
    {
      "value": null,
      "key": "Memory (Gb)"
    },
    {
      "value": null,
      "key": "Screen (inches)"
    },
    {
      "value": null,
      "key": "Warranty"
    }
  ],
  "postingId": "57ceef8fdb444c81841a003b7b129361",
  "ebay": null,
  "language": "EN",
  "images": [],
  "geo": {
    "accuracy": 0,
    "location": {
      "postalCode": "94103",
      "country": "US",
      "state": "CA",
      "city": "San Francisco"
    },
    "coordinates": [
      -122.41941550000001,
      37.7749295
    ]
  },
  "createdAt": "2015-04-09T20:15:39.026Z",
  "askingPrice": {
    "value": "40",
    "currency": "USD"
  },
  "external": {
    "threeTaps": {
      "location": {
        "state": "CA",
        "formatted": "San Francisco, CA, USA",
        "country": "US",
        "city": "USA-SFO-SNF"
      },
      "categoryGroup": "SSSS",
      "category": "SELE"
    },
    "source": {
      "code": "HSHTG"
    }
  }
}

Here's the put request to push to eBay.

Remote Address:127.0.0.1:4043
Request URL:http://localhost:4043/v1/postings/57ceef8fdb444c81841a003b7b129361/publish
Request Method:PUT
Request Payload: {"ebay":true}

Response from posting API

{
  "name": "ResourceNotFound",
  "message": "resource not found",
  "method": "PUT",
  "statusCode": 404,
  "url": "/v1/postings/57ceef8fdb444c81841a003b7b129361/publish"
}

@that1guy
Copy link
Member Author

that1guy commented Apr 9, 2015

Node logs

  21:32:52.816Z  INFO posting-api: POST /v1/postings/
        21:32:52.816Z TRACE posting-api: assigning ID 238b5284a95f42c9a87e2be5045ff304 to posting
        21:32:52.817Z TRACE posting-api: setting default expiration of 14 days for posting
        21:32:52.817Z TRACE posting-api: posting is set to expire on Thu Apr 23 2015 14:32:52 GMT-0700 (PDT)
        21:32:52.820Z TRACE posting-api: creating new posting with postingId 238b5284a95f42c9a87e2be5045ff304
        21:32:52.829Z TRACE posting-api: create posting 238b5284a95f42c9a87e2be5045ff304 completed in 13 milliseconds
        21:33:13.255Z  INFO posting-api: PUT /v1/postings/238b5284a95f42c9a87e2be5045ff304/publish
        21:33:13.255Z  WARN posting-api: 404: PUT /v1/postings/238b5284a95f42c9a87e2be5045ff304/publish

@that1guy
Copy link
Member Author

that1guy commented Apr 9, 2015

Ok, trying with only POST requests. Node logs.

    21:42:36.163Z  INFO posting-api: POST /v1/postings/
        21:42:36.164Z TRACE posting-api: assigning ID 3e314732781c4e24996dca526a4390d5 to posting
        21:42:36.165Z TRACE posting-api: setting default expiration of 14 days for posting
        21:42:36.166Z TRACE posting-api: posting is set to expire on Thu Apr 23 2015 14:42:36 GMT-0700 (PDT)
        21:42:36.170Z TRACE posting-api: creating new posting with postingId 3e314732781c4e24996dca526a4390d5
        21:42:36.183Z TRACE posting-api: create posting 3e314732781c4e24996dca526a4390d5 completed in 19 milliseconds
        21:42:40.085Z  INFO posting-api: POST /v1/postings/3e314732781c4e24996dca526a4390d5/publish
        21:42:40.089Z TRACE posting-api: find posting by ID completed in 3 milliseconds
        21:42:40.094Z TRACE posting-api: no Ebay category match found for code SELE
        21:42:41.430Z TRACE posting-api: request to create fixed price post with eBay completed in 1335 milliseconds
        21:42:41.442Z TRACE posting-api: attempt to create eBay posting completed in 1356 milliseconds
        21:42:41.443Z ERROR posting-api: 500: POST /v1/postings/3e314732781c4e24996dca526a4390d5/publish
        21:42:41.444Z ERROR posting-api: unable to publish to eBay
        err: {
          "name": "PublishingError",
          "message": "unable to publish to eBay",
          "sourceError": {
            "details": [
              {
                "ShortMessage": [
                  "Listing violates the Duplicate Listing policy."
                ],
                "LongMessage": [
                  "This Listing is a duplicate of your item: macbook air (110157906941). Under the Duplicate Listing policy, sellers can't have multiple Fixed Price listings, multiple Auction-style (with the Buy It Now option) listings, or in both the Fixed Price and Auction-style (with the Buy It Now option) listings for identical items at the same time. We recommend you create a multiple quantity Fixed Price listing to sell identical items."
                ],
                "ErrorCode": [
                  "21919067"
                ],
                "SeverityCode": [
                  "Error"
                ],
                "ErrorParameters": [
                  {
                    "$": {
                      "ParamID": "0"
                    },
                    "Value": [
                      "macbook air"
                    ]
                  },
                  {
                    "$": {
                      "ParamID": "1"
                    },
                    "Value": [
                      "110157906941"
                    ]
                  }
                ],
                "ErrorClassification": [
                  "RequestError"
                ]
              }
            ]
          },
          "statusCode": 500
        }

@that1guy
Copy link
Member Author

that1guy commented Apr 9, 2015

Most recent logs after removing duplicate ad of ebay.

 22:04:46.439Z  INFO posting-api: POST /v1/postings/
        22:04:46.440Z TRACE posting-api: assigning ID e6111c6a3d3a4ec59245d27e96134de9 to posting
        22:04:46.440Z TRACE posting-api: setting default expiration of 14 days for posting
        22:04:46.441Z TRACE posting-api: posting is set to expire on Thu Apr 23 2015 15:04:46 GMT-0700 (PDT)
        22:04:46.445Z TRACE posting-api: creating new posting with postingId e6111c6a3d3a4ec59245d27e96134de9
        22:04:46.457Z TRACE posting-api: create posting e6111c6a3d3a4ec59245d27e96134de9 completed in 17 milliseconds
        22:04:52.806Z  INFO posting-api: POST /v1/postings/e6111c6a3d3a4ec59245d27e96134de9/publish
        22:04:52.814Z TRACE posting-api: find posting by ID completed in 6 milliseconds
        22:04:52.817Z TRACE posting-api: no Ebay category match found for code SELE
        22:04:54.284Z TRACE posting-api: request to create fixed price post with eBay completed in 1466 milliseconds
        22:04:54.291Z TRACE posting-api: attempt to create eBay posting completed in 1484 milliseconds
        22:04:54.294Z TRACE posting-api: find posting by ID completed in 1 millisecond
        22:04:54.295Z TRACE posting-api: updating existing posting with postingId e6111c6a3d3a4ec59245d27e96134de9
        22:04:54.304Z ERROR posting-api: 500: POST /v1/postings/e6111c6a3d3a4ec59245d27e96134de9/publish
        22:04:54.305Z ERROR posting-api: unable to update posting by id
        err: {
          "name": "PersistenceError",
          "message": "unable to update posting by id",
          "sourceError": {
            "jse_shortmsg": "save of posting e6111c6a3d3a4ec59245d27e96134de9 failed",
            "jse_summary": "save of posting e6111c6a3d3a4ec59245d27e96134de9 failed: cannot use the part (ebay of ebay.endTime) to traverse the element ({ebay: null})",
            "jse_cause": {
              "name": "MongoError",
              "code": 16837,
              "err": "cannot use the part (ebay of ebay.endTime) to traverse the element ({ebay: null})"
            },
            "message": "save of posting e6111c6a3d3a4ec59245d27e96134de9 failed: cannot use the part (ebay of ebay.endTime) to traverse the element ({ebay: null})"
          },
          "statusCode": 500,
          "postingId": "e6111c6a3d3a4ec59245d27e96134de9"
        }

@brozeph
Copy link
Contributor

brozeph commented Apr 17, 2015

Marking as fixed now - we determined this was due to the ebay subdocument being set to null which there is now a check in the posting API model to resolve this.

@brozeph brozeph closed this as completed Apr 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants