In case anyone is having this issue independent of this plugin (such as after importing images directly through a custom script during a site transfer), here’s how I solved it:
INSERT INTO
wp_postmeta
(post_id
,meta_key
,meta_value
)
SELECT
p.ID
post_id
,
‘_wp_attached_file’ meta_key
,
REPLACE(p.guid
,’https://www.yoursite.com/wp-content/uploads/’,”) meta_value
FROM wp_posts
p
LEFT OUTER JOIN wp_postmeta
m
ON m.post_id
=p.ID
WHERE p.post_type
=’attachment’
AND p.post_parent
!=0
AND (SELECT COUNT(e.post_id
) FROM wp_postmeta
e WHERE e.meta_key
=’_wp_attached_file’ AND e.post_id
= p.ID
)=0