• Resolved pauldaditik

    (@pauldaditik)


    I get the following error when importing from uploads directory:

    Attach ID not received for inserted attachment (wp_posts table) for file: /var/www/vhosts/………../wp-content/uploads/my-image.jpg.

    Multisite ON.
    Uploads folder set to only use /uploads/ without sites-id neither year+month.

    JSON from ajax import:

    {“results”:[{“row_id”:”media-sync-item-my-image-jpg”,”inserted”:false,”error”:null,”errorMessage”:”Attach ID not received for inserted attachment (wp_posts table) for file: \/var\/www\/vhosts\/………………\/wp-content\/uploads\/my-image.jpg.”}]}

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter pauldaditik

    (@pauldaditik)

    It only creates the attachment in wp_posts but nothing in wp_postmeta.

    Plugin Author erolsk8

    (@erolsk8)

    Thanks for all these details. I’d have to setup multisite installation and try it out, to see what’s going on. I’ll let you know once I find some time to do that.

    Thread Starter pauldaditik

    (@pauldaditik)

    Nevermind my database was corrupted (‘wp_posts’ was missing primary index thus not generating ID).

    Thanks for the quick headsup!

    Not sure I understand the resolution that was given here, but I seem to be having the same issue. With some of the files (most of them sync just fine), all of which are .mp3 files so far, I get the error

    Attach ID not received for inserted attachment (wp_posts table) for file:…

    just the same as op. If there is a way to fix this issue, that information would be greatly appreciated.

    Plugin Contributor Simon Kane

    (@simonkane)

    The original solution typically requires a “database guy” to fix it.

    I would suspect that if it’s the same problem, many things are also broken – such as creating new posts, pages, and many other things depending on what your site does “over and above” basic WP (eg. WooCommerce puts shop orders in the posts table).

    Plugin Author erolsk8

    (@erolsk8)

    Hi @antillagorilla, could you please try to upload one of those problematic files manually in the default Media Library uploader, to see if it works there?

    I’m guessing WordPress itself doesn’t allow that file or file type, even though I see that .mp3 should be allowed: https://wpforms.com/docs/how-to-allow-additional-file-upload-types/

    Also, is your installation maybe multisite?

    Thanks

    Since the files were so large and I didn’t want to wait to re-upload them, I found out that another plug-in I was using (WordPress Media Library Folders) also had a sync option on a per-folder basis, so I was able to sync the files in each of the folders that Media Sync had an error for. It worked just fine with no issues.

    Also, I don’t think I have any database issues because everything else seems to be functioning fine. I also have no idea what a multisite WordPress installation is, but I’d guess mine is not.

    Plugin Author erolsk8

    (@erolsk8)

    Oh great, I’m glad you solved it.

    Thanks for the details, I’d have to try out this plugin together with “WordPress Media Library Folders”, maybe there is some conflict or something.

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘ERROR while importing: “Attach ID not received for inserted attachment”’ is closed to new replies.