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.Dismiss alert
{{ message }}
Repository navigation
Files cannot be uploaded to FTP server when included by Composer from a local 'path' repository #8781
Maybe same issue. Begin from version 26 (and exist in 27). Try upload file from folder symbolic link and nothing happens, but exception:
java.lang.IllegalArgumentException: File 'C:\Project\web\vendor_folder\yii2-shared-middleware\SomeFile.php' must be underneath base directory 'C:\Project\web\current_project'
at org.netbeans.modules.php.project.connections.transfer.LocalTransferFile.(LocalTransferFile.java:52)
at org.netbeans.modules.php.project.connections.transfer.TransferFile.fromFile(TransferFile.java:168)
at org.netbeans.modules.php.project.connections.transfer.TransferFile.fromFileObject(TransferFile.java:117)
at org.netbeans.modules.php.project.connections.RemoteClient.prepareUpload(RemoteClient.java:283)
at org.netbeans.modules.php.project.ui.actions.UploadCommand.prepareUpload(UploadCommand.java:106)
at org.netbeans.modules.php.project.ui.actions.UploadCommand.uploadFiles(UploadCommand.java:97)
at org.netbeans.modules.php.project.ui.actions.UploadCommand.invokeActionImpl(UploadCommand.java:82)
at org.netbeans.modules.php.project.ui.actions.UploadCommand$1.run(UploadCommand.java:69)
at org.netbeans.modules.php.project.ui.actions.RemoteCommand$1.run(RemoteCommand.java:83)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1403)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2018)
File upload by path C:\Project\web\current_project\vendor\yii2-shared-middleware\SomeFile.php
C:\Project\web\current_project\vendor\yii2-shared-middleware\ is symbolic folder C:\Project\web\vendor_folder
I tested this without composer and creating a symlink on windows pointing outside the directory will yield this exception if JDK24 is used.
I suspect we see fallout from https://bugs.openjdk.org/browse/JDK-8355342 here too. We might have to rework the check in the FTP integration, but before we do this, we should wait how the situation will look with a fix for the referenced issue.
java.lang.IllegalArgumentException: File 'C:\Project\web\vendor_folder\yii2-shared-middleware' must be underneath base directory 'C:\Project\web\current_project'
at org.netbeans.modules.php.project.connections.transfer.LocalTransferFile.(LocalTransferFile.java:52)
at org.netbeans.modules.php.project.connections.transfer.TransferFile.fromFile(TransferFile.java:168)
at org.netbeans.modules.php.project.connections.transfer.TransferFile.fromFile(TransferFile.java:132)
at org.netbeans.modules.php.project.connections.RemoteClient.prepareDownload(RemoteClient.java:577)
at org.netbeans.modules.php.project.connections.RemoteClient.prepareDownload(RemoteClient.java:558)
at org.netbeans.modules.php.project.ui.actions.DownloadCommand.prepareDownload(DownloadCommand.java:120)
at org.netbeans.modules.php.project.ui.actions.DownloadCommand.download(DownloadCommand.java:109)
at org.netbeans.modules.php.project.ui.actions.DownloadCommand.invokeActionImpl(DownloadCommand.java:93)
at org.netbeans.modules.php.project.ui.actions.DownloadCommand$1.run(DownloadCommand.java:71)
at org.netbeans.modules.php.project.ui.actions.RemoteCommand$1.run(RemoteCommand.java:83)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1370)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:45)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:287)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1981)
jshell> new File("C:/Temp/comp-test/consumer/vendor/demo/lib/composer.json").getAbsolutePath();
$2 ==> "C:\\Temp\\comp-test\\consumer\\vendor\\demo\\lib\\composer.json"
jshell> new File("C:/Temp/comp-test/consumer/vendor/demo/lib/composer.json").getCanonicalPath();
$3 ==> "C:\\Temp\\comp-test\\lib\\composer.json"
On linux the problem is not observed as there the file normalization uses getAbsolutePath, while the windows implementation uses getCanonicalPath. getCanonicalPath normalizes the path and resolves the junction composer uses to reference the local directory.
The file upload checks that files uploaded are "below" the project directory, which is true based on comparison of the normalized paths. We might need to do a tree search of the project directory to locate symlinks/junctions in it and record the "secondary" roots.
@UltraVioletDragon@standardpavel please have a look at #9719. The idea there is to special case the handling of junctions and symlinks. For details please have a look at the the java files. A nightly build is available from the checks page of the PR or can be directly downloaded via https://github.com/apache/netbeans/suites/105161684023/artifacts/12006963795. When you test please ensure to do this on non critical/test systems. I think I got it right, but the it must be considered experimental.
Activity
UltraVioletDragon commentedon Sep 6, 2025
Maybe same issue. Begin from version 26 (and exist in 27). Try upload file from folder symbolic link and nothing happens, but exception:
File upload by path C:\Project\web\current_project\vendor\yii2-shared-middleware\SomeFile.php
C:\Project\web\current_project\vendor\yii2-shared-middleware\ is symbolic folder C:\Project\web\vendor_folder
matthiasblaesing commentedon Oct 22, 2025
I tested this without composer and creating a symlink on windows pointing outside the directory will yield this exception if JDK24 is used.
I suspect we see fallout from https://bugs.openjdk.org/browse/JDK-8355342 here too. We might have to rework the check in the FTP integration, but before we do this, we should wait how the situation will look with a fix for the referenced issue.
UltraVioletDragon commentedon Aug 17, 2026
Bug still exists in JDK 26 and NetBeans 31
matthiasblaesing commentedon Sep 29, 2026
Steps to reproduce locally:
Package name: demo/lib
Everything else empty/default
Package name: consumer
Everything else empty/default
Update composer.json in
consumer:{ // ... "repositories": [{ "type": "path", "url": "../lib" }], "require": { "demo/lib": "dev-main" } // ... }run "composer install" in consumer
The problem ist most probably caused by this:
On linux the problem is not observed as there the file normalization uses
getAbsolutePath, while the windows implementation usesgetCanonicalPath.getCanonicalPathnormalizes the path and resolves the junction composer uses to reference the local directory.The file upload checks that files uploaded are "below" the project directory, which is true based on comparison of the normalized paths. We might need to do a tree search of the project directory to locate symlinks/junctions in it and record the "secondary" roots.
matthiasblaesing commentedon Oct 16, 2026
@UltraVioletDragon @standardpavel please have a look at #9719. The idea there is to special case the handling of junctions and symlinks. For details please have a look at the the java files. A nightly build is available from the checks page of the PR or can be directly downloaded via https://github.com/apache/netbeans/suites/105161684023/artifacts/12006963795. When you test please ensure to do this on non critical/test systems. I think I got it right, but the it must be considered experimental.