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

Text file busy when removing unused services using the cleanup class #2527

Closed
mathewberry opened this issue Dec 6, 2023 · 5 comments
Closed
Assignees

Comments

@mathewberry
Copy link

Environment details

  • OS: Ubuntu 22.04
  • PHP version: 8.1
  • Package name and version: v2.15.1

Steps to reproduce

  1. Install client composer require google/apiclient:^2.15.0
  2. Add the cleanup scripts
      "scripts": {
          "pre-autoload-dump": "Google\\Task\\Composer::cleanup"
      },
      "extra": {
          "google/apiclient-services": [
               "ShoppingContent",
          ]
      }
  3. Run composer update

Code example

composer update

Exception Example

Script Google\Task\Composer::cleanup handling the pre-autoload-dump event terminated with an exception

In Filesystem.php line 200:

Failed to remove directory "(/path/to/project/vendor/google/apiclient-services/src/._Mj2": rmdir(/path/to/project/vendor/google/apiclient-services/src/._Mj2): Text file busy
@bshaffer
Copy link
Contributor

bshaffer commented Dec 15, 2023

See #2504 and #2532

@mathewberry
Copy link
Author

I have tried this fix previously ,and again just now, in case @bshaffer but the issue still occurs. It doesn't appear to be an issue with composer timing as the dump takes a minute or 2, it just seems to be tripping up when deleting the unused services.

The script seems to rename the google/api-client-services/[DIR] folder first then start unlinking files with no issue, but gets stuck removing the Resource folder in the API service and that appears to be what's throwing the Text file busy error.

@bshaffer
Copy link
Contributor

@mathewberry thanks for the feedback, then honestly I'm not sure what could be causing the problem. It could be something wrong with the order things are being removed by the symfony Filesystem component?

@bshaffer
Copy link
Contributor

One thing I noticed here is you're receiving the error for a ._Mj2 file. I'm not sure where those are coming from, but they're not distributed as part of our package. This could be the problem.

Because we haven't received an update on this, I'm closing it for now. Please reopen it or submit a new issue if you continue to have this problem.

@mathewberry
Copy link
Author

@bshaffer I think this can stay closed, but for any update for anyone that comes across this. If you're using Windows with Virtualbox and Vagrant, the way Vagrant maps folders between the virtual environment and the physical Windows host, there can be significant lag which causes the "Text File Busy" error.

It seems to have stopped in google/apiclient v2.15.3 for myself, it could also be due to numerous factors however so I can't guarantee this will work for anyone else experiencing it.

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

No branches or pull requests

3 participants