Woocommerce-admin: Packages directory filenames are too long

Created on 4 Jun 2020  路  8Comments  路  Source: woocommerce/woocommerce-admin

Describe the bug
I'm not sure if this is the right type of issue I'm going to report, so please excuse me if I haven't picked the right one.

I'm one of the developers of Siteground Migrator plugin, and we have issues migrate WooCommerce sites after 4.0.

The problem is that the filenames generated in packages folder are too long, and we cannot create tar archive when we migrate sites to our servers.
Here is an example: woocommerce/packages/woocommerce-admin/dist/chunks/vendors~analytics-report-categories~analytics-report-coupons~analytics-report-downloads~analytics-re~2579715d.3c56dd5478f01faa4b26.js

We are using Phar::buildFromDirectory, but we get the following error when we try to archive the woocommerce directory:
Uncaught PharException: dark-based phar packages / woocommerce-admin / dist / chunks / vendors ~ analytics-report-categories ~ analytics-report-coupons ~ analytics-report-downloads ~ analytics-re ~ 2579715d.3c56dd5478f01faa4b26.js "is too long for tar file format

Is there any chance to change how filenames are generate, so they can become shorter?

Most helpful comment

Hey all just wanted to give you an update that we are working on a fix for this right now. It will reduce the file names substantially and remove the ~'s

All 8 comments

Yes agree, similar problem on my end for 6 files where I cannot commit to my projects Git repo. Screen attached. Thanks.

WC-capture

Hi @Stoyan0v,

Thank you for reporting the issue. It seems to be on the WooCommerce Admin side of things which is being developed in another repository: https://github.com/woocommerce/woocommerce-admin

I am going to move your bug report there so that the right team could take a look further. Thanks for your patience!

@Stoyan0v thanks for the report - we started looking into some solutions for this on Friday. By chance do you know the limit on the path size on Phar::buildFromDirectory?

Hey @timmyc.

According to the this post in StackOverflow, the limit is 100 symbols.

Here is the original issue: https://bugs.php.net/bug.php?id=49020
And the changes: https://github.com/php/php-src/commit/667c59abd697d5d80cb0cadf6a5cb7d94dee3a22

Let me know if there is anything else I can help :)

Hi, in my case I find what was the problem. If you have the plugin "All in one Security Wordpress" it redirects to 403 urls with ~ so, if you comment this lines in htaccess all works again. I think, it's better change the symbol to - or _

Hey all just wanted to give you an update that we are working on a fix for this right now. It will reduce the file names substantially and remove the ~'s

Hey,

I found that there is a beta version of WooCommerce, but I noticed that the long filenames still exist.

https://plugins.trac.wordpress.org/browser/woocommerce/tags/4.3.0-beta.1/packages/woocommerce-admin/dist/chunks

Would it be possible to confirm that when the official version is released, the issue will be fixed?

Hi @Stoyan0v,

There was an issue with our build where we didn't remove the long filenames. You might notice in that directory that there are shorter files with numeric names - those are the ones actually in use.

The official release will not include the unused longer filenames. See this build of WooCommerce Admin for reference: https://github.com/woocommerce/woocommerce-admin/tree/v1.3.0-rc.1/dist/chunks.

Was this page helpful?
0 / 5 - 0 ratings