question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inplace post edits are returning Fault 404: 'Invalid attachment ID.'

See original GitHub issue

I 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:open
  • Created 11 years ago
  • Comments:12 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
paulakg4commented, Nov 11, 2013

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!

1reaction
maxcutlercommented, Jul 5, 2012

WordPress gives more information in GetPost than it expects in EditPost, 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'] before EditPost. This will change it to the value expected by WordPress. Let me know if that doesn’t work and I can dig deeper.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found