twistor / flysystem-stream-wrapper

Provides the ability to register Flysystem filesystems as stream wrappers.
MIT License
58 stars 19 forks source link

PHP Warning: ftell(): supplied resource is not a valid stream resource #4

Closed ms-slasher13 closed 7 years ago

ms-slasher13 commented 7 years ago

PHP Warning: ftell(): supplied resource is not a valid stream resource in /vendor/twistor/flysystem-stream-wrapper/src/FlysystemStreamWrapper.php on line 390

BTW: When did you tag a new version?

twistor commented 7 years ago

Looks like the last tag was April of last year.

twistor commented 7 years ago

The only 2 uses of ftell() should both have valid resources.

Can you give me an example usage?

ms-slasher13 commented 7 years ago

Using PHP 7 and Drupal 8.3.1 Modules:

[Wed May 10 20:48:33.102905 2017] [:error] [pid 1216] [client 192.169.0.176:44852] PHP Warning: ftell(): supplied resource is not a valid stream resource in /vendor/twistor/flysystem-stream-wrapper/src/FlysystemStreamWrapper.php on line 390

[Wed May 10 20:48:33.041734 2017] [:error] [pid 1216] [client 192.169.0.176:44852] PHP Fatal error: Maximum execution time of 240 seconds exceeded in /src/core/lib/Drupal/Core/Cache/DatabaseBackend.php on line 138

[Wed May 10 20:48:33.102968 2017] [:error] [pid 1216] [client 192.169.0.176:44852] PHP Fatal error: Uncaught Error: Access to undeclared static property: Drupal\flysystem\FlysystemBridge::$filesystems in /src/modules/contrib/flysystem/src/FlysystemBridge.php:100\nStack trace:

0 /src/modules/contrib/flysystem/src/FlysystemBridge.php(115): Drupal\flysystem\FlysystemBridge->getFilesystemForScheme('s3')

1 /vendor/twistor/flysystem-stream-wrapper/src/FlysystemStreamWrapper.php(393): Drupal\flysystem\FlysystemBridge->getFilesystem()

2 [internal function]: Twistor\FlysystemStreamWrapper->stream_flush()

3 {main}\n thrown in /src/modules/contrib/flysystem/src/FlysystemBridge.php on line 100

Is it a deadlock?

I see that you changed the lock handling since last tagged version.

I meant when will you tag a new version?

twistor commented 7 years ago

Hmmm...

For starters, the locking in this project has nothing to do with the Database. This shouldn't be causing any deadlocks.

The static property $filesystems is declared right here: https://github.com/twistor/flysystem-stream-wrapper/blob/master/src/FlysystemStreamWrapper.php#L34

This sounds like either a bug in an underlying library, or something strange.

Those log messages are out of order.

It looks like the PHP max execution time runs first? That could be the problem.

ms-slasher13 commented 7 years ago

Sorry for the noise - it was a Database problem. Thanks