Skip to content
New issue

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

E_WARNING:unlink(/tmp/php-bolt-analytics/analytics.1732118400.json): No such file or directory #149

Closed
hetao29 opened this issue Nov 22, 2024 · 6 comments · Fixed by #150
Labels
bug Something isn't working

Comments

@hetao29
Copy link

hetao29 commented Nov 22, 2024

Describe the bug
No such file or directory

Desktop (please complete the following information):

  • OS: Ubuntu 22.04
  • PHP Version :8.3.x
  • Neo4j Version : 5.19
  • Bolt Library Version :3.1.3

Additional context

vendor/laudis/neo4j-php-client/src/BoltFactory.php(64)   Laudis\Neo4j\Bolt\ProtocolFactory::createProtocol("Bolt\\connection\\Socket::","Laudis\\Neo4j\\Authentication\\BasicAuth::","neo4j-php-client/2")^M
vendor/laudis/neo4j-php-client/src/Bolt/ProtocolFactory.php(35)  Bolt\Bolt::__construct("Bolt\\connection\\Socket::")^M
vendor/stefanak-michal/bolt/src/Bolt.php(33)     Bolt\Bolt::track()^M
vendor/stefanak-michal/bolt/src/Bolt.php(85)     unlink("/tmp/php-bolt-analytics/analytics.1732118400.json")^M
vendor/stefanak-michal/bolt/src/Bolt.php()       E_WARNING:unlink(/tmp/php-bolt-analytics/analytics.1732118400.json): No such file or directory
@hetao29 hetao29 added the bug Something isn't working label Nov 22, 2024
@stefanak-michal
Copy link
Collaborator

Hi.

The obvious solution would be to add @ ..but how the file could be missing if it existed just few miliseconds ago, because it was found by foreach (glob(sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'php-bolt-analytics' . DIRECTORY_SEPARATOR . 'analytics.*.json') as $file) { few lines higher.

Is your /tmp alias? Could realpath help mitigate this issue?

@hetao29
Copy link
Author

hetao29 commented Nov 23, 2024

If parallel web page requests are made, track() will be executed in parallel, and if the request to api-eu.mixpanel.com takes a long time, there will be a problem of deleting the same file multiple times after glob.

@stefanak-michal
Copy link
Collaborator

Later on that day I was thinking about same thing. Therefore it's ease fix, you could have create PR yourself.

@stefanak-michal
Copy link
Collaborator

Thanks for reporting this problem

@hetao29
Copy link
Author

hetao29 commented Nov 24, 2024

I thank if you simply block errors, you may still not solve the potential duplicate submission problem ^_^~~~~

@stefanak-michal
Copy link
Collaborator

I thank if you simply block errors, you may still not solve the potential duplicate submission problem ^_^~~~~

That is already solved with the way request is send. I though about it when I did implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants