Media won't sync using the wordpress plugin

Options
mbouclas
mbouclas Member Posts: 1
edited April 1 in Developer APIs

Media are stuck on uploading to cloudinary status. Using the CLI `wp cloudinary sync` or performing a manual sync using the internal api $sync->managers['push']->process_assets( $asset ); works fine. I can't download the report cause i get an error

Fatal error: Uncaught Error: Call to a member function get_public_id() on null
in /var/www/html/wp-content/plugins/cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php/sync/class-storage.php on line 395

No errors pop in the logs, the installation is fresh, using docker and the same setup works on other websites i have using the exact same docker image and plugin version.

The cloudinary version is 3.1.8, Wordpress is at 6.4.3 and PHP is at 8.2.17

Edit

Upon doing some digging, at least the report error, is caused by missing plugin instance in the class-storage file. Adding the following in the constructor solved the problem

$this->media = $plugin->get_component('media');
$this->sync = $plugin->get_component('sync');

Of course that should not be the case so something causes bad class instantiation, which is probably why the sync is not working

Tagged:

Answers

  • Wissam
    Wissam Member, Cloudinary Staff Posts: 72
    Options

    Hi @mbouclas ,

    Are you trying to sync external asset IDs?
    External media are media that have their guid that don't belong to your website domain.

    You can follow the instructions in this article:
    https://support.cloudinary.com/hc/en-us/articles/4456208611730-How-to-sync-
    external-media-
    assets
     to sync those assets.

    If this is not the case, could you open a support ticket with us directly? To do so, you can fill out the form at this link and share with us a system report as explained here and add some assets to the system report as described in the 2nd video. In addition, I would check the server logs.

    Best Regards,

    Wissam