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

[Form] InvalidArgumentException: unlink(/tmp/sf_micro_kernel): Is a directory #18512

Closed
linaori opened this issue Apr 12, 2016 · 6 comments
Closed

Comments

@linaori
Copy link
Contributor

linaori commented Apr 12, 2016

ping @nicolas-grekas I've seen this one come by several times; Sadly I don't have the time to dive in this deeper but my guess is that there's something misconfigured in the startup/teardown: https://travis-ci.org/symfony/symfony/jobs/122442688#L2951

1) Symfony\Bundle\FrameworkBundle\Tests\Templating\Helper\FormHelperDivLayoutTest::testRestAndRepeatedWithRowPerChild
InvalidArgumentException: unlink(/tmp/sf_micro_kernel): Is a directory
/home/travis/build/symfony/symfony/src/Symfony/Component/Filesystem/Filesystem.php:161
/home/travis/build/symfony/symfony/src/Symfony/Bundle/FrameworkBundle/Tests/Kernel/ConcreteMicroKernel.php:54
/home/travis/build/symfony/symfony/src/Symfony/Component/Form/Util/OrderedHashMap.php:178
/home/travis/build/symfony/symfony/src/Symfony/Component/Form/Util/OrderedHashMap.php:178
/home/travis/build/symfony/symfony/src/Symfony/Component/Form/Form.php:383
/home/travis/build/symfony/symfony/src/Symfony/Component/Form/Extension/Core/DataMapper/PropertyPathMapper.php:59
/home/travis/build/symfony/symfony/src/Symfony/Component/Form/Form.php:385
/home/travis/build/symfony/symfony/src/Symfony/Component/Form/Form.php:477
/home/travis/build/symfony/symfony/src/Symfony/Component/Form/FormBuilder.php:226
/home/travis/build/symfony/symfony/src/Symfony/Component/Form/Tests/AbstractDivLayoutTest.php:231
@nicolas-grekas
Copy link
Member

I investigated this exception, so did @xabbuh, and we don't know were this exception comes from... The stack trace suggests unlink() itself throws it, which look a bit surprising. Does anyone have an idea?

@linaori
Copy link
Contributor Author

linaori commented Apr 12, 2016

Looking at it again:

if (@(unlink($file) || rmdir($file))) {

What if this becomes:

if (@unlink($file) || @rmdir($file)) {

Maybe the real issue is that the silencing is broken here?

@xabbuh
Copy link
Member

xabbuh commented Apr 12, 2016

@iltar I thought about that too. But why does it only fail on the master branch then? The code is the same on older branches.

@linaori
Copy link
Contributor Author

linaori commented Apr 12, 2016

For me this only fails in 5.5 on travis, I assume this is related to not being able to get the latest version of something

edit: https://travis-ci.org/symfony/symfony/builds/122450786

@nicolas-grekas
Copy link
Member

And if we use the proper rmdir, this fails with
InvalidArgumentException: rmdir(/tmp/sf_micro_kernel): Directory not empty !?

nicolas-grekas added a commit that referenced this issue Apr 12, 2016
…ekas)

This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #18515).

Discussion
----------

[Filesystem] Better error handling in remove()

| Q             | A
| ------------- | ---
| Branch?       | master (to be moved on 2.3 when merging)
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #18512
| License       | MIT
| Doc PR        | -

Commits
-------

b848ddb [Filesystem] Better error handling in remove()
@kinglozzer
Copy link

If anyone’s interested, I encountered this recently and it appears to be caused by an issue with the error suppression operator when it’s used inside custom iterators: https://bugs.php.net/bug.php?id=72122

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants