Comments (7)
Yes. We can live with that workaround and give it some flexibility when same configuration without "forward slash at the end" works in other environment.
from spring-integration-extensions.
Show, please, the whole stack trace for such an error.
The RemoteFileUtils.makeDirectories()
has a logic like this:
for (String pathToCreate : pathsToCreate) {
if (logger.isDebugEnabled()) {
logger.debug("Creating '" + pathToCreate + "'");
}
session.mkdir(pathToCreate);
}
So, if you add a DEBUG logging level for the org.springframework.integration.smb.session
category, you would see what is going to be created against remote session.
Tell us also, please, how it works if you don't have that /
in the end of your path.
from spring-integration-extensions.
full path from log: int2/PRJ/data/20220303/provider/IN/
int2/PRJ/data/ exists already
20220303/provider/IN/ - do not exist yet
- stack trace is below:
- the logs as you said (obfuscated host and user) are at the middle of this message
- removing / at the end has no effect, the log is exactly the same (at first I was trying without / and I thought it's my mistake)
- if delete all the folders in the share it manages to create the first folder (int2) and then dies with the same exception and the logs you can see at the end:
1
jcifs.smb.SmbException: The network name cannot be found.
at jcifs.smb.SmbTransportImpl.checkStatus2(SmbTransportImpl.java:1467) ~[jcifs-2.1.28.jar:na]
at jcifs.smb.SmbTransportImpl.checkStatus(SmbTransportImpl.java:1578) ~[jcifs-2.1.28.jar:na]
at jcifs.smb.SmbTransportImpl.sendrecv(SmbTransportImpl.java:1027) ~[jcifs-2.1.28.jar:na]
at jcifs.smb.SmbTransportImpl.send(SmbTransportImpl.java:1549) ~[jcifs-2.1.28.jar:na]
at jcifs.smb.SmbSessionImpl.send(SmbSessionImpl.java:409) ~[jcifs-2.1.28.jar:na]
at jcifs.smb.SmbSessionImpl.send(SmbSessionImpl.java:347) ~[jcifs-2.1.28.jar:na]
at jcifs.smb.SmbTreeImpl.treeConnect(SmbTreeImpl.java:611) ~[jcifs-2.1.28.jar:na]
at jcifs.smb.SmbTreeConnection.connectTree(SmbTreeConnection.java:614) ~[jcifs-2.1.28.jar:na]
at jcifs.smb.SmbTreeConnection.connectHost(SmbTreeConnection.java:568) ~[jcifs-2.1.28.jar:na]
at jcifs.smb.SmbTreeConnection.connectHost(SmbTreeConnection.java:489) ~[jcifs-2.1.28.jar:na]
at jcifs.smb.SmbTreeConnection.connect(SmbTreeConnection.java:465) ~[jcifs-2.1.28.jar:na]
at jcifs.smb.SmbTreeConnection.connectWrapException(SmbTreeConnection.java:426) ~[jcifs-2.1.28.jar:na]
at jcifs.smb.SmbFile.ensureTreeConnected(SmbFile.java:573) ~[jcifs-2.1.28.jar:na]
at jcifs.smb.SmbFile.exists(SmbFile.java:873) ~[jcifs-2.1.28.jar:na]
at jcifs.smb.SmbFile.mkdirs(SmbFile.java:1702) ~[jcifs-2.1.28.jar:na]
at org.springframework.integration.smb.session.SmbSession.mkdir(SmbSession.java:276) ~[spring-integration-smb-1.2.1.RELEASE.jar:na]
at org.springframework.integration.file.remote.RemoteFileUtils.tryCreateRemoteDirectory(RemoteFileUtils.java:83) ~[spring-integration-file-5.5.7.jar:5.5.7]
at org.springframework.integration.file.remote.RemoteFileUtils.makeDirectories(RemoteFileUtils.java:73) ~[spring-integration-file-5.5.7.jar:5.5.7]
at org.springframework.integration.file.remote.RemoteFileTemplate.sendFileToRemoteDirectory(RemoteFileTemplate.java:561) ~[spring-integration-file-5.5.7.jar:5.5.7]
at org.springframework.integration.file.remote.RemoteFileTemplate.doSend(RemoteFileTemplate.java:353) ~[spring-integration-file-5.5.7.jar:5.5.7]
at org.springframework.integration.file.remote.RemoteFileTemplate.lambda$send$0(RemoteFileTemplate.java:314) ~[spring-integration-file-5.5.7.jar:5.5.7]
at org.springframework.integration.file.remote.RemoteFileTemplate.execute(RemoteFileTemplate.java:452) ~[spring-integration-file-5.5.7.jar:5.5.7]
at org.springframework.integration.file.remote.RemoteFileTemplate.send(RemoteFileTemplate.java:314) ~[spring-integration-file-5.5.7.jar:5.5.7]
at org.springframework.integration.file.remote.RemoteFileTemplate.send(RemoteFileTemplate.java:302) ~[spring-integration-file-5.5.7.jar:5.5.7]
at org.springframework.integration.file.remote.RemoteFileTemplate.send(RemoteFileTemplate.java:294) ~[spring-integration-file-5.5.7.jar:5.5.7]
at org.springframework.integration.file.remote.handler.FileTransferringMessageHandler.handleMessageInternal(FileTransferringMessageHandler.java:207) ~[spring-integration-file-5.5.7.jar:5.5.7]
at org.springframework.integration.handler.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:56) ~[spring-integration-core-5.5.7.jar:5.5.7]
....
2
22:20:54.086 [http-nio-9990-exec-2] DEBUG o.s.i.smb.session.SmbSession - New org.springframework.integration.smb.session.SmbSession created.
22:20:54.092 [http-nio-9990-exec-2] DEBUG o.s.i.smb.session.SmbSession - Created new jcifs.smb.SmbFile[smb://user:Password123%40@host:0/int2/PRJ/data/20220303/provider/IN/] for path [int2/PRJ/data/20220303/provider/IN/].
22:20:54.120 [http-nio-9990-exec-2] DEBUG o.s.i.smb.session.SmbSession - Created new jcifs.smb.SmbFile[smb://user:Password123%40@host:0/int2/PRJ/data/20220303/provider/IN] for path [int2/PRJ/data/20220303/provider/IN].
22:20:54.132 [http-nio-9990-exec-2] DEBUG o.s.i.smb.session.SmbSession - Created new jcifs.smb.SmbFile[smb://user:Password123%40@host:0/int2/PRJ/data/20220303/provider] for path [int2/PRJ/data/20220303/provider].
22:20:54.142 [http-nio-9990-exec-2] DEBUG o.s.i.smb.session.SmbSession - Created new jcifs.smb.SmbFile[smb://user:Password123%40@host:0/int2/PRJ/data/20220303] for path [int2/PRJ/data/20220303].
22:20:54.152 [http-nio-9990-exec-2] DEBUG o.s.i.smb.session.SmbSession - Created new jcifs.smb.SmbFile[smb://user:Password123%40@host:0/int2/PRJ/data/] for path [int2/PRJ/data/].
22:20:54.152 [http-nio-9990-exec-2] DEBUG o.s.i.smb.session.SmbSession - Created new jcifs.smb.SmbFile[smb://user:Password123%40@host:0/int2/PRJ/data/] for path [int2/PRJ/data].
22:20:54.172 [http-nio-9990-exec-2] DEBUG o.s.i.s.s.SmbRemoteFileTemplate - Creating 'int2/PRJ/data/20220303'
22:20:54.182 [http-nio-9990-exec-2] DEBUG o.s.i.smb.session.SmbSession - Created new jcifs.smb.SmbFile[smb://user:Password123%40@host:0/int2/PRJ/data/20220303/] for path [int2/PRJ/data/20220303/].
22:20:54.182 [http-nio-9990-exec-2] DEBUG o.s.i.smb.session.SmbSession - Created new jcifs.smb.SmbFile[smb://user:Password123%40@host:0/int2/PRJ/data/20220303/] for path [int2/PRJ/data/20220303].
...
4
22:51:15.756 [http-nio-9990-exec-6] DEBUG o.s.i.smb.session.SmbSession - New org.springframework.integration.smb.session.SmbSession created.
22:51:15.756 [http-nio-9990-exec-6] DEBUG o.s.i.smb.session.SmbSession - Created new jcifs.smb.SmbFile[smb://user:Password123%40@host:0/int2/PRJ/data/20220303/provider/IN/] for path [int2/PRJ/data/20220303/provider/IN/].
22:51:15.839 [http-nio-9990-exec-6] DEBUG o.s.i.smb.session.SmbSession - Created new jcifs.smb.SmbFile[smb://user:Password123%40@host:0/int2/PRJ/data/20220303/provider/IN] for path [int2/PRJ/data/20220303/provider/IN].
22:51:15.889 [http-nio-9990-exec-6] DEBUG o.s.i.smb.session.SmbSession - Created new jcifs.smb.SmbFile[smb://user:Password123%40@host:0/int2/PRJ/data/20220303/provider] for path [int2/PRJ/data/20220303/provider].
22:51:15.950 [http-nio-9990-exec-6] DEBUG o.s.i.smb.session.SmbSession - Created new jcifs.smb.SmbFile[smb://user:Password123%40@host:0/int2/PRJ/data/20220303] for path [int2/PRJ/data/20220303].
22:51:15.999 [http-nio-9990-exec-6] DEBUG o.s.i.smb.session.SmbSession - Created new jcifs.smb.SmbFile[smb://user:Password123%40@host:0/int2/PRJ/data] for path [int2/PRJ/data].
22:51:16.009 [http-nio-9990-exec-6] DEBUG o.s.i.smb.session.SmbSession - Created new jcifs.smb.SmbFile[smb://user:Password123%40@host:0/int2/PRJ] for path [int2/PRJ].
22:51:16.059 [http-nio-9990-exec-6] DEBUG o.s.i.smb.session.SmbSession - Created new jcifs.smb.SmbFile[smb://user:Password123%40@host:0/int2] for path [int2].
22:51:16.059 [http-nio-9990-exec-6] DEBUG o.s.i.s.s.SmbRemoteFileTemplate - Creating 'int2'
22:51:16.109 [http-nio-9990-exec-6] DEBUG o.s.i.smb.session.SmbSession - Created new jcifs.smb.SmbFile[smb://user:Password123%40@host:0/int2/] for path [int2/].
22:51:16.109 [http-nio-9990-exec-6] DEBUG o.s.i.smb.session.SmbSession - Created new jcifs.smb.SmbFile[smb://user:Password123%40@host:0/int2/] for path [int2].
22:51:16.219 [http-nio-9990-exec-6] INFO o.s.i.smb.session.SmbSession - Successfully created remote directory [int2] in share [smb://user:Password123%40@host:0/vfs_dev_00009].
22:51:16.219 [http-nio-9990-exec-6] DEBUG o.s.i.s.s.SmbRemoteFileTemplate - Creating 'int2/PRJ'
22:51:16.229 [http-nio-9990-exec-6] DEBUG o.s.i.smb.session.SmbSession - Created new jcifs.smb.SmbFile[smb://user:Password123%40@host:0/int2/PRJ/] for path [int2/PRJ/].
22:51:16.229 [http-nio-9990-exec-6] DEBUG o.s.i.smb.session.SmbSession - Created new jcifs.smb.SmbFile[smb://user:Password123%40@host:0/int2/PRJ/] for path [int2/PRJ].
22:51:16.295 [http-nio-9990-exec-6] DEBUG o.s.web.servlet.DispatcherServlet - Failed to complete request: org.springframework.messaging.MessageDeliveryException:
from spring-integration-extensions.
This is the part of JCIFS where that exception is thrown:
default:
if ( log.isDebugEnabled() ) {
log.debug("Error code: 0x" + Hexdump.toHexString(resp.getErrorCode(), 8) + " for " + req.getClass().getSimpleName());
}
throw new SmbException(resp.getErrorCode(), null);
}
Doesn't looks like there is something we can do with this problem in this project.
I suggest you to raise the concern with JCIFS community or your SMB vendor.
Perhaps you got some limits for your requests?..
from spring-integration-extensions.
seems that I found out the problem in the end:
smbRemoteFileTemplate should be initialized with a SmbSessionFactory
object whose value of its shareAndDir
property should contain an /
at the end
from spring-integration-extensions.
Hm.
We have a logic in there in the SmbConfig
like this:
if (!path.startsWith("/")) {
path = "/" + path;
}
According to your findings it looks like we also have to add /
into the end.
If that is what you are thinking, too, feel free to contribute the fix.
Thank you!
from spring-integration-extensions.
Hm. We have a logic in there in the
SmbConfig
like this:if (!path.startsWith("/")) { path = "/" + path; }
According to your findings it looks like we also have to add
/
into the end.If that is what you are thinking, too, feel free to contribute the fix.
Thank you!
Not sure if this is a good idea to always force a forward slash at the end... I'd like to understand all the use cases before we allow this in the code.
As stated this is mitigated anyways by the configuration setting in the SmbSessionFactory initialization.
from spring-integration-extensions.
Related Issues (20)
- spring-integration-smb 1.1 does not work with spring integration 5.2. HOT 4
- Upgrade Cassandra to version 4 HOT 1
- spring-integration-smb memory leak in SmbShare HOT 1
- Memory leak with org.springframework.integration.hazelcast.leader.LeaderInitiator HOT 2
- HazelcastContext does not implement getRole() method HOT 1
- Hazelcast LeaderInitiator inconsistent yielding HOT 5
- Zip: If there is a problem with unzipping and deleteFiles is true then original file is deleted
- zip: Exception during unzip deletes original file if deleteFiles is true. HOT 1
- Spring Integration SMB Half Upload on Graceful Shutdown HOT 4
- spring-integration-zip: Status? HOT 4
- Deprecate fileReplace option from SmbSessionFactory and remove it in future HOT 7
- Spring Integration LockRegistry support for Cosmos HOT 1
- HazelcastMessageStore should use keySet instead of values HOT 3
- Doesn't build with Java 17, and old jcifs HOT 1
- Can't create nested directories on SMB share HOT 1
- Migrate this repo into Spring Integration repo HOT 17
- Consider using another samba support library instead of jcifs HOT 2
- Restarting HZ cluster will not re-establish any leadership HOT 5
- spring-integration-smb not supports Spring 6 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from spring-integration-extensions.