Inplace post edits are returning Fault 404: 'Invalid attachment ID.'
See original GitHub issueI am trying to use your library (v2.1) to write a script to replace broken links after a blog migration to Wordpress.com. After retrieving posts and making corrections to the post.body, I
if not(wp.call(EditPost(post.id, post))):
logging.error("Unable to edit post %s" % (post.id))
else:
logging.info("Successfully updated post %s" % (post.id))
Running this consistently yields this error, irrespective of the post in question or whether any changes were made:
Traceback (most recent call last):
File "wplinkrepair.py", line 260, in <module>
fix_errors=args.repair)
File "wplinkrepair.py", line 206, in process_broken_links
if not(wp.call(EditPost(post.id, post))):
File "C:\Python27\lib\site-packages\wordpress_xmlrpc\base.py", line 37, in call
raw_result = server_method(*args)
File "C:\Python27\lib\xmlrpclib.py", line 1224, in __call__
return self.__send(self.__name, args)
File "C:\Python27\lib\xmlrpclib.py", line 1575, in __request
verbose=self.__verbose
File "C:\Python27\lib\xmlrpclib.py", line 1264, in request
return self.single_request(host, handler, request_body, verbose)
File "C:\Python27\lib\xmlrpclib.py", line 1297, in single_request
return self.parse_response(response)
File "C:\Python27\lib\xmlrpclib.py", line 1473, in parse_response
return u.close()
File "C:\Python27\lib\xmlrpclib.py", line 793, in close
raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 404: 'Invalid attachment ID.'>```
Any suggestions?
Issue Analytics
- State:
- Created 11 years ago
- Comments:12 (2 by maintainers)
Top Results From Across the Web
3255522 - Invalid Attachment IDs | SAP Knowledge Base Article
In some circumstances, attachments can't be added or modified using a corresponding UI field. This may lead to or be the result of...
Read more >Error codes – Quickbase Help
Code Message Possible Cause
0 No error No error
1 Unknown error
4 Bad ticket
Read more >20 Common Feed Errors in Facebook Dynamic Product Ads
20 most common feed errors for Facebook Dynamic Product Ads. We'll go over how to ... Product identifiers; Image errors; Invalid values; Processing...
Read more >REST API error codes - DocuSign Developers
However, depending on the error, the server might return HTML in place of the ... PUT & POST requests } else if (statusCode...
Read more >Delete Article-Attachments(s)-Link API - eGain
More than one article Id is supplied in the URI. Required system parameter i.e. $lang is missing. Unsupported query parameters in request URI....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
just running into the same issue and the solution:
post.thumbnail = post.thumbnail[‘attachment_id’] before EditPost
did in fact fix the problem for me - Thanks!
WordPress gives more information in
GetPost
than it expects inEditPost
, which is leading to this issue. I can handle it better in the library, and I’ll try to do so in the next release.In the meantime, you can try calling
post.thumbnail = post.thumbnail['attachment_id']
beforeEditPost
. This will change it to the value expected by WordPress. Let me know if that doesn’t work and I can dig deeper.