Php valid stream resource

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

supplied resource is not a valid stream resource #11

supplied resource is not a valid stream resource #11

Comments

The text was updated successfully, but these errors were encountered:

Читайте также:  Link code for javascript

Sorry, I’ve not saw your issue before today. I think the problem comes with this statement :
https://github.com/walkor/Workerman/blob/master/Connection/AsyncTcpConnection.php#L261

I need to check this in debug mode but for me, when you call the del function, followed by event_del statement, it seems that the object after unset does not have any more references to him. The garbage collector passes, and kills the object (line 153 on libevent.c), and the ressource is also closed.

After investigations, this line is changes to be compliant with PHP7 (zend_list_delete to zend_list_close)

In most user extension functions like mysql_close(), you should use zend_list_close() instead of zend_list_delete(). This closes the actual connection and frees extension specific data structures, but doesn’t free the zend_reference structure. that might be still referenced from zval(s). This also doesn’t decrement the resource reference counter.

So when the event is destroyed (no more references to him), the connection is closed, that explains your warnings.

One solution could be to revert back to zend_list_delete but I believe that makes memory leaks (not sure).

Sorry but I have no time to work again on libevent, maybe in few month I will be back again on this but for now I’m stuck on other projects.

If you know C fork me and make a pull request, I’ll check it and package it for windows libraries.

@ichiriac , I need to fix the bug , Please fix it ASAP and help me
Thanks

ok @sm2017, ping me back in 1 month if it’s not moving. I’ll update this issue when it will be fixed.

Thanks a lot , I will check this page periodically
Thanks again 👍

@ichiriac i have this issue too but i forget that if you solve its nice help for me

I’ll take a look at this tonight

I’ll continue tomorrow, I’ve did not succeed to force the GC with a small code

I hope , the following references helps

stream_socket_client — STREAM_CLIENT_ASYNC_CONNECT

EV_WRITE

supplied resource is not a valid stream resource

fd argument must be either valid PHP stream or valid PHP socket resource

The issue should be fixed, can you try by rebuilding from sources or do you need windows binaries ?

I can’t reproduce the bug directly as in PHP7 it’s not easy to trigger the GC, so I need you to test and tell me if it’s OK.

Then I’ll take tome time to find out a way to trigger properly the garbage collector, in order to cover this ticket with tests

I install libevent @05900f3b8d70deb424b3193a4eb850062f146638 , but same result , I have supplied resource is not a valid stream resource error

Before event_free the $fd is resource of type (stream) and after resource of type (Unknown) so in next lines we have supplied resource is not a valid stream resource error

I install again libevent extension and run test script the result is

 /* poll STDIN using basic API */ function foo($fd, $events, $arg) < static $i; $i++; if ($i == 10) < event_base_loopexit($arg[1]); > var_dump(fread($fd, 1)); > $base = event_base_new(); $fd = fopen('https://raw.githubusercontent.com/expressif/pecl-event-libevent/master/tests/input.txt', 'r'); // first event reader $ev1 = event_new(); var_dump(event_set($ev1, $fd, EV_READ | EV_PERSIST, "foo", array($ev1, $base))); var_dump(event_base_set($ev1, $base)); var_dump(event_add($ev1)); var_dump(event_base_loop($base, EVLOOP_ONCE)); var_dump(event_del($ev1)); var_dump($fd); event_free($ev1); unset($ev1); var_dump($fd); // second event reader $ev2 = event_new(); var_dump(event_set($ev2, $fd, EV_READ | EV_PERSIST, "foo", array($ev2, $base))); var_dump(event_base_set($ev2, $base)); var_dump(event_add($ev2)); var_dump(event_base_loop($base, EVLOOP_ONCE)); var_dump(event_del($ev2)); unset($ev2); ?>
bool(true) bool(true) bool(true) string(1) "0" int(0) bool(true) resource(6) of type (stream) resource(6) of type (Unknown) PHP Warning: event_set(): fd argument must be either valid PHP stream or valid PHP socket resource in /home/libeventBug/test.php on line 35 bool(false) bool(false) PHP Warning: event_add(): Unable to add event without an event base in /home/libeventBug/test.php on line 37 bool(false) int(1) PHP Warning: event_del(): Unable to delete event without an event base in /home/libeventBug/test.php on line 39 bool(false) [warn] event_del: event has no event_base set. 

Источник

Ошибка при записи из массива в файл — Is not a valid stream resource

Ошибка при работе с картинкой «not a valid Image resource»
Привет! Загружаю картинки, автоматом уменьшаю их размеры, для этих целей использую самописную ф-ю.

ошибка mysql_fetch_array(): supplied argument is not a valid MySQL result resource
Доброе время суток. товарищи вэб мастера помагите разобратся с ошибкой. заливаю на хост сайт и.

Ошибка Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource
Добрый вечер, помогите определить ошибку. При клике на объект выдает ошибку Warning.

Ошибка CS1583 в веб-приложении — ‘filename’ is not a valid Win32 resource file
Здравствуйте, господа. Уже 3ий день после ребилда приложения получаю ошибку: Compiler Error.

Лучший ответ

Сообщение было отмечено Balalamb как решение

Решение

$fh=fopen('result_1.txt', 'a') or die ("создать файл не удалось"); foreach ($konk1 as $j=>$k1){ foreach ($k1 as $key=>$value) {$text .= "$value&";} } fwrite($fh, $text); fclose($fh);

Trukl, Спасибо, работает! И рядом можно вопрос?
У меня получается запись: «Красные&14&Синие&15»
а в итоге нужно, чтобы ключ=значение было, я не могу понять , как туда переменную добавить, что бы получалось: Команда1=Красные&Очки1=14&Команда2=Синие&Очки2=15

Лучший ответ

Сообщение было отмечено Balalamb как решение

Решение

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[S3] fclose(): supplied resource is not a valid stream resource #23373

[S3] fclose(): supplied resource is not a valid stream resource #23373

0. Needs triage Pending check for reproducibility or if it fits our roadmap bug feature: object storage

Comments

Server configuration

Web server: Nginx

Database: MariaDB

PHP version: 7.4.11

Nextcloud version: (see Nextcloud admin page) 19.0.4

Signing status:

No errors have been found. 

List of activated apps:

Enabled: - accessibility: 1.5.0 - apporder: 0.11.0 - breezedark: 19.0.4 - calendar: 2.0.4 - cloud_federation_api: 1.2.0 - comments: 1.9.0 - contacts: 3.4.0 - contactsinteraction: 1.0.0 - cospend: 1.0.5 - dav: 1.15.0 - deck: 1.1.0 - drop_account: 0.2.1 - federatedfilesharing: 1.9.0 - federation: 1.9.0 - files: 1.14.0 - files_accesscontrol: 1.9.1 - files_antivirus: 3.0.0 - files_automatedtagging: 1.9.0 - files_rightclick: 0.16.0 - files_sharing: 1.11.0 - files_trashbin: 1.9.0 - files_versions: 1.12.0 - files_videoplayer: 1.8.0 - impersonate: 1.6.1 - logreader: 2.4.0 - lookup_server_connector: 1.7.0 - metadata: 0.12.0 - notes: 3.6.4 - notifications: 2.7.0 - oauth2: 1.7.0 - password_policy: 1.9.1 - photos: 1.1.0 - provisioning_api: 1.9.0 - quota_warning: 1.8.0 - ransomware_protection: 1.7.0 - settings: 1.1.0 - sharebymail: 1.9.0 - tasks: 0.13.3 - theming: 1.10.0 - twofactor_admin: 3.0.0 - twofactor_backupcodes: 1.8.0 - twofactor_nextcloud_notification: 2.3.0 - twofactor_totp: 5.0.0 - twofactor_u2f: 6.0.0 - viewer: 1.3.0 - workflowengine: 2.1.0 Disabled: - activity - admin_audit - encryption - facerecognition - files_external - files_pdfviewer - firstrunwizard - nextcloud_announcements - privacy - recommendations - serverinfo - social - support - survey_client - systemtags - text - updatenotification - user_ldap 

Nextcloud configuration:

 < "system": < "objectstore": < "class": "\\OC\\Files\\ObjectStore\\S3", "arguments": < "bucket": "example", "key": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "hostname": "minio.lan", "port": 7777, "use_ssl": false, "region": "europe1", "use_path_style": true >>, "logfile": "\/var\/log\/nextcloud\/example.com.log", "memcache.locking": "\\OC\\Memcache\\Redis", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "example.com" ], "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "mysql", "version": "19.0.4.2", "overwrite.cli.url": "https:\/\/example.com", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbtableprefix": "oc_", "mysql.utf8mb4": true, "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "dbdriveroptions": < "1009": "\/etc\/ssl\/mysql\/ca-cert.pem", "1008": "\/etc\/ssl\/mysql\/client-cert.pem", "1007": "\/etc\/ssl\/mysql\/client-key.pem", "1014": false >, "skeletondirectory": "", "activity_expire_days": 14, "auth.bruteforce.protection.enabled": false, "htaccess.RewriteBase": "\/", "integrity.check.disabled": false, "knowledgebaseenabled": false, "logtimezone": "Europe\/Paris", "maintenance": false, "memcache.local": "\\OC\\Memcache\\Redis", "memcache.distributed": "\\OC\\Memcache\\Redis", "updatechecker": false, "appstoreenabled": false, "upgrade.disable-web": true, "filelocking.enabled": true, "overwriteprotocol": "https", "preview_max_scale_factor": 1, "redis": < "host": "***REMOVED SENSITIVE VALUE***", "port": 6379, "timeout": 0, "dbindex": 19, "password": "***REMOVED SENSITIVE VALUE***" >, "trashbin_retention_obligation": "auto, 7", "updater.release.channel": "stable", "mail_smtpmode": "smtp", "mail_smtpsecure": "tls", "mail_sendmailmode": "smtp", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtpauth": 1, "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "587", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "enabledPreviewProviders": [ "OC\\Preview\\PNG", "OC\\Preview\\JPEG", "OC\\Preview\\GIF" ], "instanceid": "***REMOVED SENSITIVE VALUE***", "overwritehost": "example.com", "default_language": "fr", "default_locale": "fr_FR", "preview_max_x": "1280", "preview_max_y": "800", "jpeg_quality": "70", "loglevel": 3, "simpleSignUpLink.shown": false, "logfilemode": 420 > > 

Logs

Web server error log

Insert your webserver log here 

Nextcloud log (data/nextcloud.log)

< "app":"PHP", "method":"POST", "url":"/ocs/v2.php/cloud/users", "message":< "Exception":"Error", "Message":"fclose(): supplied resource is not a valid stream resource at /lib/private/Files/ObjectStore/S3ObjectTrait.php#107", "Code":0, "Trace":[ < "function":"onError", "class":"OC\\Log\\ErrorHandler", "type":"::" >, < "file":"/lib/private/Files/ObjectStore/S3ObjectTrait.php", "line":107, "function":"fclose" >, < "file":"/lib/private/Files/ObjectStore/ObjectStoreStorage.php", "line":477, "function":"writeObject", "class":"OC\\Files\\ObjectStore\\S3", "type":"->" >, < "file":"/lib/private/Files/ObjectStore/ObjectStoreStorage.php", "line":407, "function":"writeStream", "class":"OC\\Files\\ObjectStore\\ObjectStoreStorage", "type":"->" >, < "file":"/lib/private/Files/ObjectStore/ObjectStoreStorage.php", "line":320, "function":"writeBack", "class":"OC\\Files\\ObjectStore\\ObjectStoreStorage", "type":"->" >, < "function":"OC\\Files\\ObjectStore\\", "class":"OC\\Files\\ObjectStore\\ObjectStoreStorage", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] >, < "file":"/3rdparty/icewind/streams/src/CallbackWrapper.php", "line":121, "function":"call_user_func" >, < "function":"stream_close", "class":"Icewind\\Streams\\CallbackWrapper", "type":"->" >, < "file":"/lib/private/Files/ObjectStore/ObjectStoreStorage.php", "line":428, "function":"fclose" >, < "file":"/lib/private/Files/Storage/Wrapper/Wrapper.php", "line":257, "function":"file_put_contents", "class":"OC\\Files\\ObjectStore\\ObjectStoreStorage", "type":"->" >, < "file":"/lib/private/Files/Storage/Wrapper/Availability.php", "line":275, "function":"file_put_contents", "class":"OC\\Files\\Storage\\Wrapper\\Wrapper", "type":"->" >, < "file":"/lib/private/Files/Storage/Wrapper/Wrapper.php", "line":257, "function":"file_put_contents", "class":"OC\\Files\\Storage\\Wrapper\\Availability", "type":"->" >, < "file":"/lib/private/Files/Storage/Wrapper/Wrapper.php", "line":257, "function":"file_put_contents", "class":"OC\\Files\\Storage\\Wrapper\\Wrapper", "type":"->" >, < "file":"/apps/files_accesscontrol/lib/StorageWrapper.php", "line":276, "function":"file_put_contents", "class":"OC\\Files\\Storage\\Wrapper\\Wrapper", "type":"->" >, < "file":"/apps/ransomware_protection/lib/StorageWrapper.php", "line":252, "function":"file_put_contents", "class":"OCA\\FilesAccessControl\\StorageWrapper", "type":"->" >, < "file":"/lib/private/Files/View.php", "line":1159, "function":"file_put_contents", "class":"OCA\\RansomwareProtection\\StorageWrapper", "type":"->" >, < "file":"/lib/private/Files/View.php", "line":696, "function":"basicOperation", "class":"OC\\Files\\View", "type":"->" >, < "file":"/lib/private/Files/Node/Folder.php", "line":187, "function":"file_put_contents", "class":"OC\\Files\\View", "type":"->" >, < "file":"/lib/private/Files/SimpleFS/SimpleFolder.php", "line":90, "function":"newFile", "class":"OC\\Files\\Node\\Folder", "type":"->" >, < "file":"/lib/private/Avatar/UserAvatar.php", "line":256, "function":"newFile", "class":"OC\\Files\\SimpleFS\\SimpleFolder", "type":"->" >, < "file":"/lib/private/Avatar/Avatar.php", "line":111, "function":"getFile", "class":"OC\\Avatar\\UserAvatar", "type":"->" >, < "file":"/lib/private/User/User.php", "line":441, "function":"get", "class":"OC\\Avatar\\Avatar", "type":"->" >, < "file":"/apps/dav/lib/CardDAV/Converter.php", "line":146, "function":"getAvatarImage", "class":"OC\\User\\User", "type":"->" >, < "file":"/apps/dav/lib/CardDAV/Converter.php", "line":57, "function":"getAvatarImage", "class":"OCA\\DAV\\CardDAV\\Converter", "type":"->" >, < "file":"/apps/dav/lib/CardDAV/SyncService.php", "line":283, "function":"createCardFromUser", "class":"OCA\\DAV\\CardDAV\\Converter", "type":"->" >, < "file":"/apps/dav/lib/HookManager.php", "line":148, "function":"updateUser", "class":"OCA\\DAV\\CardDAV\\SyncService", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] >, < "file":"/lib/private/legacy/OC_Hook.php", "line":110, "function":"changeUser", "class":"OCA\\DAV\\HookManager", "type":"->" >, < "file":"/lib/private/Server.php", "line":591, "function":"emit", "class":"OC_Hook", "type":"::" >, < "function":"OC\\", "class":"OC\\Server", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] >, < "file":"/lib/private/Hooks/EmitterTrait.php", "line":101, "function":"call_user_func_array" >, < "file":"/lib/private/Hooks/PublicEmitter.php", "line":40, "function":"emit", "class":"OC\\Hooks\\BasicEmitter", "type":"->" >, < "file":"/lib/private/User/User.php", "line":483, "function":"emit", "class":"OC\\Hooks\\PublicEmitter", "type":"->" >, < "file":"/lib/private/Avatar/UserAvatar.php", "line":213, "function":"triggerChange", "class":"OC\\User\\User", "type":"->" >, < "file":"/lib/private/Avatar/UserAvatar.php", "line":326, "function":"remove", "class":"OC\\Avatar\\UserAvatar", "type":"->" >, < "file":"/lib/private/Server.php", "line":1425, "function":"userChanged", "class":"OC\\Avatar\\UserAvatar", "type":"->" >, < "file":"/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line":264, "function":"OC\\", "class":"OC\\Server", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] >, < "file":"/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line":239, "function":"doDispatch", "class":"Symfony\\Component\\EventDispatcher\\EventDispatcher", "type":"->" >, < "file":"/3rdparty/symfony/event-dispatcher/EventDispatcher.php", "line":73, "function":"callListeners", "class":"Symfony\\Component\\EventDispatcher\\EventDispatcher", "type":"->" >, < "file":"/lib/private/EventDispatcher/SymfonyAdapter.php", "line":70, "function":"dispatch", "class":"Symfony\\Component\\EventDispatcher\\EventDispatcher", "type":"->" >, < "file":"/lib/private/User/User.php", "line":480, "function":"dispatch", "class":"OC\\EventDispatcher\\SymfonyAdapter", "type":"->" >, < "file":"/lib/private/User/User.php", "line":152, "function":"triggerChange", "class":"OC\\User\\User", "type":"->" >, < "file":"/apps/provisioning_api/lib/Controller/UsersController.php", "line":534, "function":"setDisplayName", "class":"OC\\User\\User", "type":"->" >, < "file":"/apps/provisioning_api/lib/Controller/UsersController.php", "line":326, "function":"editUser", "class":"OCA\\Provisioning_API\\Controller\\UsersController", "type":"->" >, < "file":"/lib/private/AppFramework/Http/Dispatcher.php", "line":170, "function":"addUser", "class":"OCA\\Provisioning_API\\Controller\\UsersController", "type":"->", "args":[ "*** sensitive parameters replaced ***" ] >, < "file":"/lib/private/AppFramework/Http/Dispatcher.php", "line":100, "function":"executeController", "class":"OC\\AppFramework\\Http\\Dispatcher", "type":"->" >, < "file":"/lib/private/AppFramework/App.php", "line":137, "function":"dispatch", "class":"OC\\AppFramework\\Http\\Dispatcher", "type":"->" >, < "file":"/lib/private/AppFramework/Routing/RouteActionHandler.php", "line":47, "function":"main", "class":"OC\\AppFramework\\App", "type":"::" >, < "function":"__invoke", "class":"OC\\AppFramework\\Routing\\RouteActionHandler", "type":"->" >, < "file":"/lib/private/Route/Router.php", "line":297, "function":"call_user_func" >, < "file":"/ocs/v1.php", "line":88, "function":"match", "class":"OC\\Route\\Router", "type":"->" >, < "file":"/ocs/v2.php", "line":24, "args":[ "/ocs/v1.php" ], "function":"require_once" >], "File":"/lib/private/Log/ErrorHandler.php", "Line":91, "CustomMessage":"--" >, "userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0", "version":"19.0.4.2", "id":"5f842510c4b21" > 

The text was updated successfully, but these errors were encountered:

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

supplied resource is not a valid stream resource #793

supplied resource is not a valid stream resource #793

Comments

Describe the bug
predis/predis/src/Connection/StreamConnection.php:291 is throwing an exception.
Except this, predis seems to be working as expected.

fwrite(): supplied resource is not a valid stream resource  

To Reproduce
Use predis with PHP 8.1.6

Expected behavior
It should not throw exception even if the resource is already closed.

Versions (please complete the following information):

Additional context
I think it is throwing an exception because the fwrite behavior was changed in PHP8.
php/doc-en#1581

The text was updated successfully, but these errors were encountered:

Источник

Оцените статью