Reading BLOB data from SQL and write it to file share

Dear Community,

I am successful in creating a pipeline that read blob data from SQL server and writing the file in SLDB. Now, I wanted to write the file on an SFTP server using File Writer - validation is okay but failed during execution.

protocol: smb
file name, = enable: targetDir + ‘/’ + $ID+ '’ + $[‘last-modified’] + ‘.jpg’
write empty file: check

error: Failed to open output stream for … Reason:
Unable to create/open

Thanks in advance for the help.

Is it SFTP or SMB protocol? Can you please provide the stacktrace?

You mentioned that the validation was fine. Was the execution mode of File Writer set to Validate & Execute?

SMB protocol. I tried setting to Validate & Execute. Below is the stack trace

Failed to open output stream for <share_destination>\id_2021-08-13T22:23:16.629Z.jpg

Resolution:

Please address reported issue.

Reason:

Unable to create/open - <share_destination>\id_2021-08-13T22:23:16.629Z.jpg

Hide Details…

File Writer[5e4268b8907fe00481d73d56_f5dc8c06-411f-46aa-b384-a284c4111483 – 58ab1969-8579-4490-8cde-08e309c17bfe]
`com.snaplogic.snap.api.SnapDataException: Failed to open output stream for <share_destination>\id_2021-08-13T22:23:16.629Z.jpg

at com.snaplogic.snap.api.fs.smb.SmbUrlConnection.getOutputStream(SmbUrlConnection.java:86)

at com.snaplogic.snaps.binary.AbstractWriter.initOutputStream(AbstractWriter.java:815)

at com.snaplogic.snaps.binary.AbstractWriter.writeData(AbstractWriter.java:492)

at com.snaplogic.snaps.binary.AbstractWriter.process(AbstractWriter.java:364)

at com.snaplogic.snaps.binary.AbstractWriter.doWork(AbstractWriter.java:321)

at com.snaplogic.snap.api.SimpleBinarySnap.execute(SimpleBinarySnap.java:57)

at com.snaplogic.cc.snap.common.SnapRunnableImpl.executeSnap(SnapRunnableImpl.java:803)

at com.snaplogic.cc.snap.common.SnapRunnableImpl.execute(SnapRunnableImpl.java:585)

at com.snaplogic.cc.snap.common.SnapRunnableImpl.doRun(SnapRunnableImpl.java:869)

at com.snaplogic.cc.snap.common.SnapRunnableImpl.call(SnapRunnableImpl.java:435)

at com.snaplogic.cc.snap.common.SnapRunnableImpl.call(SnapRunnableImpl.java:117)

at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)

at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)

at java.base/java.lang.Thread.run(Thread.java:834)

Caused by: Unable to create/open - <share_destination>\id_2021-08-13T22:23:16.629Z.jpg status = -1073741773 (0xc0000033)

at com.visuality.nq.client.File.openOrCreate(File.java:3123)

at com.visuality.nq.client.File.create(File.java:926)

at com.visuality.nq.client.File.<init>(File.java:877)

at com.visuality.nq.client.SmbOutputStream.<init>(SmbOutputStream.java:78)

at com.snaplogic.snap.api.fs.smb.SmbUrlConnection.getOutputStream(SmbUrlConnection.java:84)

... 16 more

Reason: Unable to create/open - <share_destination>\id_2021-08-13T22:23:16.629Z.jpg
Resolution: Please address reported issue.

Error Fingerprint[0] = efp:com.snaplogic.snap.api.fs.smb.IvR2q0Gr
Error Fingerprint[1] = efp:com.visuality.nq.client.79BHBWNu`

File Writer[5e4268b8907fe00481d73d56_f5dc8c06-411f-46aa-b384-a284c4111483 – 58ab1969-8579-4490-8cde-08e309c17bfe]
`com.snaplogic.cc.snap.common.ThreadDetails: prio=4 Id=96986 RUNNABLE
at java.base@11.0.7/java.lang.StackTraceElement.initStackTraceElements(Native Method)
at java.base@11.0.7/java.lang.StackTraceElement.of(StackTraceElement.java:526)
at java.base@11.0.7/java.lang.Throwable.getOurStackTrace(Throwable.java:828)
at java.base@11.0.7/java.lang.Throwable.getStackTrace(Throwable.java:820)
at com.visuality.nq.common.InternalTraceLog.log(InternalTraceLog.java:327)
at com.visuality.nq.common.InternalTraceLog.enter(InternalTraceLog.java:442)
at com.visuality.nq.client.Mount.close(Mount.java:468)
at com.snaplogic.snap.api.fs.smb.SmbUrlConnection.disconnect(SmbUrlConnection.java:54)

at java.base@11.0.7/java.lang.StackTraceElement.initStackTraceElements(Native Method)

at java.base@11.0.7/java.lang.StackTraceElement.of(StackTraceElement.java:526)

at java.base@11.0.7/java.lang.Throwable.getOurStackTrace(Throwable.java:828)

at java.base@11.0.7/java.lang.Throwable.getStackTrace(Throwable.java:820)

at com.visuality.nq.common.InternalTraceLog.log(InternalTraceLog.java:327)

at com.visuality.nq.common.InternalTraceLog.enter(InternalTraceLog.java:442)

at com.visuality.nq.client.Mount.close(Mount.java:468)

at com.snaplogic.snap.api.fs.smb.SmbUrlConnection.disconnect(SmbUrlConnection.java:54)

at com.snaplogic.snap.api.binary.UrlUtils.disconnect(UrlUtils.java:185)

at com.snaplogic.snaps.binary.AbstractWriter.cleanup(AbstractWriter.java:635)

at com.snaplogic.snaps.binary.AbstractWriter.consume(AbstractWriter.java:916)

at com.snaplogic.snaps.binary.AbstractWriter.writeData(AbstractWriter.java:529)

at com.snaplogic.snaps.binary.AbstractWriter.process(AbstractWriter.java:364)

at com.snaplogic.snaps.binary.AbstractWriter.doWork(AbstractWriter.java:321)

at com.snaplogic.snap.api.SimpleBinarySnap.execute(SimpleBinarySnap.java:57)

at com.snaplogic.cc.snap.common.SnapRunnableImpl.executeSnap(SnapRunnableImpl.java:803)

at com.snaplogic.cc.snap.common.SnapRunnableImpl.execute(SnapRunnableImpl.java:585)

at com.snaplogic.cc.snap.common.SnapRunnableImpl.doRun(SnapRunnableImpl.java:869)

at com.snaplogic.cc.snap.common.SnapRunnableImpl.call(SnapRunnableImpl.java:435)

at com.snaplogic.cc.snap.common.SnapRunnableImpl.call(SnapRunnableImpl.java:117)

at java.base@11.0.7/java.util.concurrent.FutureTask.run(FutureTask.java:264)

at java.base@11.0.7/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)

at java.base@11.0.7/java.util.concurrent.FutureTask.run(FutureTask.java:264)

at java.base@11.0.7/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)

at java.base@11.0.7/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)

at java.base@11.0.7/java.lang.Thread.run(Thread.java:834)

Error Fingerprint[0] = efp:java.lang.JJL-PXqh`

The problem is the filename contains an illegal character :

The following characters are not allowed for SMB directory and file names: " \ / : | < > * ?

1 Like

the illegal character is the value of

“last-modified”: “2021-08-13T22:51:44.288 UTC”

so I removed that for now and it works!!! I guess I need to format that value to an acceptable format. thank you for your help @siwadon!!!