Closed nikgilbe closed 1 year ago
I am getting the same error when calling the upload() method
try {
$feedType = FeedType::POST_FBA_INBOUND_CARTON_CONTENTS;
$feedsApi = new FeedsApi($config);
// Create feed document
$createFeedDocSpec = new Feeds\CreateFeedDocumentSpecification(['content_type' => $feedType['contentType']]);
$feedDocumentInfo = $feedsApi->createFeedDocument($createFeedDocSpec);
$feedDocumentId = $feedDocumentInfo->getFeedDocumentId();
// Upload feed contents to document
$feedContents = file_get_contents(FCPATH.'../inventoryFeed.xml');
$docToUpload = new SellingPartnerApi\Document($feedDocumentInfo, $feedType);
$docToUpload->upload($feedContents);
$createFeedSpec = new Feeds\CreateFeedSpecification();
$createFeedSpec->setMarketplaceIds([$marketplace_id]);
$createFeedSpec->setInputFeedDocumentId($feedDocumentId);
$createFeedSpec->setFeedType($feedType['name']);
$createFeedResult = $feedsApi->createFeed($createFeedSpec);
$feedId = $createFeedResult->getFeedId();
if ($feedId) {
$this->db->where('id',$fba_shipment['id'])->update('fba_shipment',array('feed_on'=>date('Y-m-d H:i:s'),'feed_submission_id'=>$feedId,'feed_status'=>'submitted','modified_on'=>date('Y-m-d H:i:s'),'modified_by'=>$user));
}
$this->logs->log('log_mws',array('id'=>$result['headers']['x-amzn-RequestId'][0],'fba_id'=>str_replace('F','',$fba['id']),'fba_shipment_id'=>$fba_shipment['id'],'result'=>'successful','type'=>'carton_feed_submission','request'=>'','response'=>'','created_on'=>date('Y-m-d H:i:s'),'created_by'=>$user));
} catch (Exception $e) {
$response = $e->getMessage();
print_r($response);exit;
$this->logs->log('log_mws',array('fba_id'=>str_replace('F','',$fba['id']),'fba_shipment_id'=>$fba_shipment['id'],'result'=>'failed','type'=>'carton_feed_submission','failed_message'=>$response,'request'=>'','response'=>'','created_on'=>date('Y-m-d H:i:s'),'created_by'=>$user));
$this->error = $response;
exit;
}
The error I am getting is
`PUT https://tortuga-prod-na.s3-external-1.amazonaws.com/%2FNinetyDays/amzn1.tortuga.4.na.cfafa93f-b187-4365-9c48-1fae6675ca50.TGMA2AEAQRBZP?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20230221T080021Z&X-Amz-SignedHeaders=content-type%3Bhost&X-Amz-Expires=300&X-Amz-Credential=AKIA5U6MO6RABV4GCCBL%2F20230221%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=5f573727d59beb1f8ba715fe1e071ed060623ea816052d6ea2d2c92f1a2588a4` resulted in a `403 Forbidden` response: SignatureDoesNotMatchThe request signature we calcul (truncated...)`
Do you know if the Amazon Seller you're connecting to changed their LWA tokens? https://developer-docs.amazon.com/sp-api/changelog/important-you-must-rotate-your-login-with-amazon-lwa-credentials-client-secrets-for-all-applications-every-180-days I've had this happen with one of my clients already who changed it without letting me know.
Do you know if the Amazon Seller you're connecting to changed their LWA tokens? https://developer-docs.amazon.com/sp-api/changelog/important-you-must-rotate-your-login-with-amazon-lwa-credentials-client-secrets-for-all-applications-every-180-days I've had this happen with one of my clients already who changed it without letting me know.
Hi - the sellers are actually me and a colleague, so this shouldn't be the case. The fact other APIs are working is what is confusing me, it's just the upload that fails, whatever the type of feed.
I have the same problem. I tried to change the refreshtoken but it doesn't work. Maybe Amazon have actually problems.
Interesting, thanks. I've not had any response yet from Amazon on the case raised, will update if it gets resolved there
The signed URL used by the upload
method is also actually generated by Amazon themselves...the library doesn't calculate that signature. But just to make sure this isn't related to a library change – did any of you update the library version right before this error started? There was a minor change to the upload
method in the latest release (v5.6.0
) which I released 4 days ago.
I did update, on the 17th itself I believe so I didn't think to check that as the issue didn't start until last night. But I have just done a downgrade to 5.5.4, and it's working.......
2 inventory feeds in quick succession just being loaded by Amazon - thank you - it didn't occur to me to try downgrading for some reason.
Yeah same here.I'm in the process of implementing the SP-API and therefore have the newest version since yesterday. Thank u!
And processing reports received successfully, so all back to normal my side.
Thanks again - for your next trick, can you fix an issue I'm having with o365 emails / oauth /authentication ? :-)
I'm going to leave this open, because clearly there's some bug with the latest version. Are you guys working with reports that you expect to be using a charset other than utf-8
? Japanese reports and some EU reports fall into this category
OK, no problem. Should be UTF-8 only for me (UK only)
Downgrading to 5.5.4 helped. Thanks!
Me too, after an upgrade this morning! Downgrade to 5.5.4 helped.
I did not have the time to test exactly what functions worked and what not, but I remember invoice upload and fba inbound failed. Both use uploads at some point.
I had to downgrade it as well :(
Same issue here. Upgraded to 5.6 today and we could not upload any feeds. Feeds are ISO-8856-15 encoded.
Same issue for EU. Downgrading to 5.5.4 resolved problem.
Also EU and downgraded solved it
I just noticed, I get the same error if I try to pass the charset, like with the new "withContentType" function.
$createFeedDocSpec = new Feeds\CreateFeedDocumentSpecification(['content_type' => $feedType['contentType'].'; charset='.$charset]);
Could it be there is some sort of conversion happening AFTER the signature calculation is done ? Or maybe the header is changed after signature calculation.
Thanks for your patience everyone – this should be fixed in v5.7.0
.
It's been a few month since I last updated (or rather downgraded to 5.5.4) the library. Since I ran into a codepage issue, I tried the recent 5.10.2 and use utf-8 (EU marketplace, so default seems to be cp1252). But when I add a charset to the upload function, I still get a wrong signature error. Could it really be this issue is only partially resolved ?
$docToUpload = new SellingPartnerApi\Document($feedDocumentInfo, $feedType);
$docToUpload->upload($feedContents,'utf-8');
I have to remove the 2nd parameter or else I get a signature error.
What happens if you pass cp1252
as the encoding parameter?
And @nikgilbe, sorry to drag you back into this...are you on the latest version of the library? And are you running into these errors?
$docToUpload->upload($feedContents,'cp1252');
Also results in SignatureDoesNotMatch.
Sorry, I'm still on an old version. I need to update a number of libraries, but need to find the right time to do it. Will update when I do if things working as expected or not.
Problem description:
Since last night, around 7:40GMT, with no code or config updates, we have started receiving a 403 error when trying to upload any feeds (inventory, shipping updates). This has been working fine for many months, and other APIs are still working fine (e.g. getOrders, getMyFeesEstimates) so I don't believe but could easily be wrong) it to be a problem with access keys, secrets etc. We have refreshed them just in case, but no change. The error happens at $docToUpload->upload($feedContents). I have raised a case with Seller Central, but am hoping someone here may have a suggestion as I have had to turn off our "shop" till we can resolve it.
Error:
SignatureDoesNotMatch