[
https://issues.apache.org/jira/browse/NIFI-13400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17856310#comment-17856310
]
Joe Witt commented on NIFI-13400:
---------------------------------
Yeah I think it isn't really about smb itself but just giving the container
time to be in a state to accept commands. I noticed messing with some other
lines that the test failed the same way but there was some startup entries in
the log. IE before the change I'd see...
{noformat}
[main] INFO org.testcontainers.dockerclient.DockerClientProviderStrategy -
Loaded org.testcontainers.dockerclient.UnixSocketClientProviderStrategy from
~/.testcontainers.properties, will try it first
[main] INFO org.testcontainers.dockerclient.DockerClientProviderStrategy -
Found Docker environment with local Unix socket (unix:///var/run/docker.sock)
[main] INFO org.testcontainers.DockerClientFactory - Docker host IP address is
localhost
[main] INFO org.testcontainers.DockerClientFactory - Connected to docker:
Server Version: 26.1.4
API Version: 1.45
Operating System: Fedora Linux 40 (Workstation Edition)
Total Memory: 31759 MB
[main] INFO tc.testcontainers/ryuk:0.7.0 - Creating container for image:
testcontainers/ryuk:0.7.0
[main] INFO org.testcontainers.utility.RegistryAuthLocator - Failure when
attempting to lookup auth config. Please ignore if you don't have images in an
authenticated registry. Details: (dockerImageName: testcontainers/ryuk:0.7.0,
configFile: /home/apachenifi/.docker/config.json, configEnv:
DOCKER_AUTH_CONFIG). Falling back to docker-java default behaviour. Exception
message: Status 404: No config supplied. Checked in order:
/home/apachenifi/.docker/config.json (file not found), DOCKER_AUTH_CONFIG (not
set)
[main] INFO tc.testcontainers/ryuk:0.7.0 - Container testcontainers/ryuk:0.7.0
is starting: f4f66ec154df4b3d045d9b41cdbd95abc96fe3f3031d6edcc7f0560d7936bab9
[main] INFO tc.testcontainers/ryuk:0.7.0 - Container testcontainers/ryuk:0.7.0
started in PT0.739399658S
[main] INFO org.testcontainers.utility.RyukResourceReaper - Ryuk started - will
monitor and terminate Testcontainers containers on JVM exit
[main] INFO org.testcontainers.DockerClientFactory - Checking the system...
[main] INFO org.testcontainers.DockerClientFactory - ✔︎ Docker server version
should be at least 1.6.0
[main] INFO tc.dperson/samba:latest - Creating container for image:
dperson/samba:latest
[main] INFO tc.dperson/samba:latest - Container dperson/samba:latest is
starting: dd453476fdc0347554246591df13269f438f1311462959db9575d3d429b7dbd8
[main] INFO tc.dperson/samba:latest - Container dperson/samba:latest started in
PT0.808913075S
[docker-java-stream--1492825682] INFO org.apache.nifi.processors.smb.SmbDfsIT -
STDOUT: Added user myuser.
[docker-java-stream--1492825682] INFO org.apache.nifi.processors.smb.SmbDfsIT -
STDOUT: smbd version 4.12.2 started.
[docker-java-stream--1492825682] INFO org.apache.nifi.processors.smb.SmbDfsIT -
STDOUT: Copyright Andrew Tridgell and the Samba Team 1992-2020
[Packet Reader for localhost] INFO
com.hierynomus.smbj.transport.tcp.direct.DirectTcpPacketReader - PacketReader
error, got exception.
{noformat}
Then I messed around with some additional command in the test which caused a
little delay and made it get further so I saw
{noformat}
[main] INFO org.testcontainers.dockerclient.DockerClientProviderStrategy -
Loaded org.testcontainers.dockerclient.UnixSocketClientProviderStrategy from
~/.testcontainers.properties, will try it first
[main] INFO org.testcontainers.dockerclient.DockerClientProviderStrategy -
Found Docker environment with local Unix socket (unix:///var/run/docker.sock)
[main] INFO org.testcontainers.DockerClientFactory - Docker host IP address is
localhost
[main] INFO org.testcontainers.DockerClientFactory - Connected to docker:
Server Version: 26.1.4
API Version: 1.45
Operating System: Fedora Linux 40 (Workstation Edition)
Total Memory: 31759 MB
[main] INFO tc.testcontainers/ryuk:0.7.0 - Creating container for image:
testcontainers/ryuk:0.7.0
[main] INFO org.testcontainers.utility.RegistryAuthLocator - Failure when
attempting to lookup auth config. Please ignore if you don't have images in an
authenticated registry. Details: (dockerImageName: testcontainers/ryuk:0.7.0,
configFile: /home/apachenifi/.docker/config.json, configEnv:
DOCKER_AUTH_CONFIG). Falling back to docker-java default behaviour. Exception
message: Status 404: No config supplied. Checked in order:
/home/apachenifi/.docker/config.json (file not found), DOCKER_AUTH_CONFIG (not
set)
[main] INFO tc.testcontainers/ryuk:0.7.0 - Container testcontainers/ryuk:0.7.0
is starting: 787203d88cc16e833b2bf77ed728db1547c465395996e5040f5746dcf2213b9a
[main] INFO tc.testcontainers/ryuk:0.7.0 - Container testcontainers/ryuk:0.7.0
started in PT0.766428696S
[main] INFO org.testcontainers.utility.RyukResourceReaper - Ryuk started - will
monitor and terminate Testcontainers containers on JVM exit
[main] INFO org.testcontainers.DockerClientFactory - Checking the system...
[main] INFO org.testcontainers.DockerClientFactory - ✔︎ Docker server version
should be at least 1.6.0
[main] INFO tc.dperson/samba:latest - Creating container for image:
dperson/samba:latest
[main] INFO tc.dperson/samba:latest - Container dperson/samba:latest is
starting: 2deaeaabc377774b87cddfc85785724248fbea2b668a1d2c687575b777f78307
[main] INFO tc.dperson/samba:latest - Container dperson/samba:latest started in
PT0.850068196S
[docker-java-stream-1749075120] INFO org.apache.nifi.processors.smb.SmbDfsIT -
STDOUT: Added user myuser.
[docker-java-stream-1749075120] INFO org.apache.nifi.processors.smb.SmbDfsIT -
STDOUT: smbd version 4.12.2 started.
[docker-java-stream-1749075120] INFO org.apache.nifi.processors.smb.SmbDfsIT -
STDOUT: Copyright Andrew Tridgell and the Samba Team 1992-2020
[docker-java-stream-1749075120] INFO org.apache.nifi.processors.smb.SmbDfsIT -
STDOUT: daemon_ready: daemon 'smbd' finished starting up and ready to serve
connections
[pool-2-thread-1] INFO com.hierynomus.smbj.connection.PacketEncryptor -
Initialized PacketEncryptor with Cipher << null >>
[pool-2-thread-1] INFO com.hierynomus.smbj.connection.Connection - Successfully
connected to: localhost
[pool-2-thread-1] INFO com.hierynomus.smbj.connection.SMBSessionBuilder -
Successfully authenticated myuser on localhost, session is 212409001
[pool-2-thread-1] INFO com.hierynomus.smbj.session.Session - Connecting to
\\localhost\dfs-share on session 212409001
[pool-2-thread-1] INFO com.hierynomus.smbj.paths.DFSPathResolver - Starting DFS
resolution for \\localhost\dfs-share\dfs-link\fetch_file
[pool-2-thread-1] INFO com.hierynomus.smbj.session.Session - Connecting to
\\localhost\IPC$ on session 212409001
[docker-java-stream-1749075120] INFO org.apache.nifi.processors.smb.SmbDfsIT -
STDOUT: vfswrap_read_dfs_pathat: Error reading msdfs link dfs-link/fetch_file:
No such file or directory
[docker-java-stream-1749075120] INFO org.apache.nifi.processors.smb.SmbDfsIT -
STDOUT: vfswrap_read_dfs_pathat: Error reading msdfs link dfs-link: No such
file or directory
[pool-2-thread-1] INFO com.hierynomus.smbj.session.Session - Logging off
session 212409001 from host localhost
[pool-2-thread-1] ERROR org.apache.nifi.processors.smb.FetchSmb -
FetchSmb[id=2b93a39c-a437-4f5d-ba77-c461c338b980] Could not fetch file
dfs-link/fetch_file.: org.apache.nifi.services.smb.SmbException:
STATUS_OBJECT_PATH_NOT_FOUND (0xc000003a): Create failed for
\\localhost\dfs-share\dfs-link\fetch_file
org.apache.nifi.services.smb.SmbException: STATUS_OBJECT_PATH_NOT_FOUND
(0xc000003a): Create failed for \\localhost\dfs-share\dfs-link\fetch_file
at
org.apache.nifi.services.smb.SmbjClientService.wrapException(SmbjClientService.java:191)
{noformat}
So then it seemed pretty obvious to me that there was a timing issue. Once I
re-ordered that sleep to 'give it time to start' it was game on and hasn't
failed since.
> SmbDfsIT failures
> ------------------
>
> Key: NIFI-13400
> URL: https://issues.apache.org/jira/browse/NIFI-13400
> Project: Apache NiFi
> Issue Type: Task
> Environment: Apache Maven 3.9.6
> (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)
> Maven home: /development/tools/apache-maven-3.9.6
> Java version: 21.0.3, vendor: Azul Systems, Inc., runtime:
> /usr/lib/jvm/zulu21.34.19-ca-jdk21.0.3-linux_x64
> Default locale: en_US, platform encoding: UTF-8
> OS name: "linux", version: "6.8.9-200.fc39.x86_64", arch: "amd64", family:
> "unix"
> Reporter: Joe Witt
> Assignee: Peter Turcsanyi
> Priority: Major
> Fix For: 2.0.0-M4
>
> Attachments: TEST-org.apache.nifi.processors.smb.SmbDfsIT.xml
>
>
> [ERROR] Failures:
> [ERROR] SmbDfsIT.testFetchSmb:94 expected: <1> but was: <0>
> [ERROR] SmbDfsIT.testGetSmbFile:185 expected: <1> but was: <0>
> [ERROR] SmbDfsIT.testListSmbWithDfsLink:121->testListSmb:143 expected: <1>
> but was: <0>
> [ERROR] SmbDfsIT.testPutSmbFile:165 expected: <1> but was: <0>
> NIFI-12837 introduced this IT. It does not appear to work successfully on
> linux hosts. Unclear exactly. Does seem to work on osx. Perhaps the test
> is setup to assume arm or something.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)