Forum

Thread tagged as: Problem, Error

Cloud Storage Asset Upload Error

Hello,

I have set up Rackspace Cloud Files / CDN, but when trying to upload an image nothing happens no error in debug.

But closer look into PHP error logs shows this error is triggering when trying to upload an image:

[16-Mar-2017 16:47:18 Europe/London] PHP Fatal error:  Cannot use lexical variable $eventName as a parameter name in /path-to-site/admin/addons/apps/perch_openstack/lib/guzzlehttp/guzzle/src/Event/Emitter.php on line 49

Any advice?

Dexter Harrison

Dexter Harrison 29 points

  • 4 years ago

Seems to be an error with a version of Guzzle on PHP 7.1

https://github.com/guzzle/guzzle/pull/1393

Confirmed thats the issue, dropping down to PHP 5.6 fixed the issue.

Could we get a fix for this?

Drew McLellan

Drew McLellan 2638 points
Perch Support

I can certainly look into it.

Drew McLellan

Drew McLellan 2638 points
Perch Support

We can't update to the current version of the library, as they've bumped their minimum dependancy to PHP 7.0 and ours is 5.4.

I've applied the patch you've linked to. Can you confirm that resolves the problem for you?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Great, thanks. That'll be in Runway 3.

Looks like we'll be bumping the minimum requirements for cloud storage to 7.0 before long.

Perfect thanks Drew,

I'll leave this patch in on my copy until 3 is available

Got it all working locally, but for some reason when I've pushed it up live I'm getting errors uploading images.

[17-Mar-2017 15:17:46 Europe/London] PHP Warning:  Container not found. in site/path/admin/addons/apps/perch_openstack/lib/openstack/openstack-sdk-php/src/OpenStack/ObjectStore/v1/Resource/StreamWrapper.php on line 799

[17-Mar-2017 15:17:46 Europe/London] PHP Warning:  move_uploaded_file(swift://images/test-image.jpg): failed to open stream: "OpenStack\ObjectStore\v1\Resource\StreamWrapper::stream_open" call failed in site/path/admin/core/lib/PerchUtil.class.php on line 772

[17-Mar-2017 15:17:46 Europe/London] PHP Warning:  move_uploaded_file(): Unable to move '/tmp/phprEfyko' to 'swift://images/test-image.jpg' in site/path/admin/core/lib/PerchUtil.class.php on line 772

[17-Mar-2017 15:17:46 Europe/London] PHP Warning:  Container not found. in site/path/admin/addons/apps/perch_openstack/lib/openstack/openstack-sdk-php/src/OpenStack/ObjectStore/v1/Resource/StreamWrapper.php on line 799

[17-Mar-2017 15:17:46 Europe/London] PHP Warning:  getimagesize(swift://images/test-image.jpg): failed to open stream: "OpenStack\ObjectStore\v1\Resource\StreamWrapper::stream_open" call failed in site/path/admin/core/lib/PerchImage.class.php on line 308

[17-Mar-2017 15:17:46 Europe/London] PHP Warning:  Container not found. in site/path/admin/addons/apps/perch_openstack/lib/openstack/openstack-sdk-php/src/OpenStack/ObjectStore/v1/Resource/StreamWrapper.php on line 799

[17-Mar-2017 15:17:46 Europe/London] PHP Warning:  finfo_file(swift://images/test-image.jpg): failed to open stream: "OpenStack\ObjectStore\v1\Resource\StreamWrapper::stream_open" call failed in site/path/admin/core/lib/PerchImage.class.php on line 402

[17-Mar-2017 15:17:47 Europe/London] PHP Fatal error:  Call to a member function reindex() on boolean in site/path/admin/core/apps/assets/modes/upload.pre.php on line 38

Says the container does not exist, although it does. Works perfectly locally

Drew McLellan

Drew McLellan 2638 points
Perch Support

Sure you've not missed deploying a config file?

I'm fairly sure, it's deployed with git

Drew McLellan

Drew McLellan 2638 points
Perch Support

What's the difference between local and live?

Nothing obvious that I can think of, these are both running PHP 5.6, both been set up the same and not had these sort of problems for the 3 years it's been running Perch!

Drew McLellan

Drew McLellan 2638 points
Perch Support

You've checked your runway.php and buckets.php files?

Yes both are correct, and exactly the same as local

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok. What else can you tell me?

Fixed it, character was uppercase -.-

Cheers Drew

Is there a way to move assets from multiple buckets into one (Cloud Files).

I don't mind manually moving the files, or writing the update script if it's possible to point me in the right direction to what needs updating?

Drew McLellan

Drew McLellan 2638 points
Perch Support

There's no way to move assets between buckets at the moment.