NielsLiisberg / vscode-ibm-i-run-sql-with-acs

IBM i run SQL from ACS
Apache License 2.0
5 stars 2 forks source link

Command 'IBM i run 'SQL from ACS' resulted in an error (Cannot read property 'path' of undefined) #3

Open karldreis opened 2 years ago

karldreis commented 2 years ago

This is the ibm-i-run-from-sql-from-acs field: C:\Users\Karl.Dreis\IBM\ClientSolutions\acsbundle.jar. This is correct and I get the error in subject?

NielsLiisberg commented 2 years ago

What if you just enter

C:\Users\Karl.Dreis\IBM\ClientSolutions\acsbundle.jar

on the command prompt in windows ( not from VSCode) - does it open then ?

NielsLiisberg commented 2 years ago

In your case, the config should look like this:

image
karldreis commented 2 years ago

Thank you for the response. Much appreciated! So I ran the command from the command prompt as you requested and the program launched successfully. But when I updated the extension setting AcsJar with the path as you suggested it still did not work. I am wondering if there is a permissions issue or a path issue? But if I run from the command prompt it is resolving to the executable. Not sure what the issue is to tell you the truth?

On Wed, Mar 16, 2022 at 3:22 AM Niels Liisberg @.***> wrote:

In your case, the config should look like this:

[image: image] https://user-images.githubusercontent.com/2787230/158568953-2d288679-d2de-4665-a08a-8cb166347d56.png

— Reply to this email directly, view it on GitHub https://github.com/NielsLiisberg/vscode-ibm-i-run-sql-with-acs/issues/3#issuecomment-1068962213, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXSGPSV62VMUXQFKAVVHKMDVAGY6NANCNFSM5P6EXRZA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.*** com>

NielsLiisberg commented 2 years ago

perhaps try the command it is issuing:

java -jar C:\Users\Karl.Dreis\IBM\ClientSolutions\acsbundle.jar /plugin=rss /autorun=0 /file="full-path-to-your-ASC-SQL-file.sql"

NielsLiisberg commented 2 years ago

1) try to quote it - perhaps it is the DOT in your path is the issue:

2) try to copy acsbundle.jar to C:\temp\acsbundle.jar and change the config accordingly

karldreis commented 2 years ago

Hello Niels,

I copy/pasted the jar file to the temp directory. I then updated the path in the extension. I tired to run the command from the command palette and I get the same error message.

[image: image.png]

On Thu, Mar 17, 2022 at 2:28 AM Niels Liisberg @.***> wrote:

1.

try to quote it - perhaps it is the DOT in your path is the issue:

1.

try to copy acsbundle.jar to C:\temp\acsbundle.jar and change the config accordingly

— Reply to this email directly, view it on GitHub https://github.com/NielsLiisberg/vscode-ibm-i-run-sql-with-acs/issues/3#issuecomment-1070618612, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXSGPSV5Z6LBAQUWCDEKL23VAL3KTANCNFSM5P6EXRZA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.*** com>

NielsLiisberg commented 2 years ago

And what it you run the temp jar like the plug in will do - like:

java -jar C:\temp\acsbundle.jar /plugin=rss /autorun=0 /file="full-path-to-your-ASC-SQL-file.sql"

karldreis commented 2 years ago

Niels,

Thank you for the help. If I run it as you requested. It launches ACS without issue. I still don't know why I would get the error that I have described when trying to launch it from the command palette within VS Code?

[image: image.png]

On Fri, Mar 18, 2022 at 6:21 AM Niels Liisberg @.***> wrote:

And what it you run the temp jar like the plug in will do - like:

java -jar C:\temp\acsbundle.jar /plugin=rss /autorun=0 /file="full-path-to-your-ASC-SQL-file.sql"

— Reply to this email directly, view it on GitHub https://github.com/NielsLiisberg/vscode-ibm-i-run-sql-with-acs/issues/3#issuecomment-1072404490, or unsubscribe https://github.com/notifications/unsubscribe-auth/AXSGPSXLTJHNPLC3DBNDYELVAR7NDANCNFSM5P6EXRZA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you authored the thread.Message ID: @.*** com>

NielsLiisberg commented 2 years ago

I really want to help you, however it must be something in your setting that causes the trouble.

my extension is using child_process and exec

Perhaps you can search at bit on the net , and help me to get this extension perfect. Something like:

Any help will be appreciated.

djurrep commented 1 year ago

Hi Niels,

I am trying this extension and get the same error when using it from the command palette inside a VS code file editor panel . If I try to run the same .sql file by right-clicking on it in the VS code Explorer file tree, ACS is started correctly.

NielsLiisberg commented 1 year ago

Is that on Windows, Mac or Linux ?

søn. 1. okt. 2023 kl. 12.23 skrev djurrep @.***>:

Hi Niels,

I am trying this extension and get the same error when using it from the command palette inside a VS code file editor panel . If I try to run the same .sql file by right-clicking on it in the VS code Explorer file tree, ACS is started correctly.

— Reply to this email directly, view it on GitHub https://github.com/NielsLiisberg/vscode-ibm-i-run-sql-with-acs/issues/3#issuecomment-1742033830, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVIPHUU4YWPFY43XJMXJHTX5FAARANCNFSM5P6EXRZA . You are receiving this because you commented.Message ID: @.*** com>

djurrep commented 1 year ago

That's on Windows

Edition Windows 10 Enterprise Version 22H2 OS build 19045.3448 Experience Windows Feature Experience Pack 1000.19044.1000.0

But it works fine for me now. Mapped an IFS folder as Network-drive so that I can save the ACS scripts directly refreshing the VS code panel with a click.

NielsLiisberg commented 1 year ago

I am looking into it, and it is a mystery. The Extension button ( IBM i run SQL from ACS) appears correctly for the file in the upper left corner - I assume.

is it a "strange" file name ( containing UTF-8 chars, spaces, dashes or alike) ?

My extension is so simple so it must be the "child_process" "exec" that fails

perhaps this link will help you, (if you files is located on a mapped drive or alike ):

https://stackoverflow.com/questions/55864278/how-to-fix-typeerror-cannot-read-property-path-of-undefined-in-nodejsmulte

On Sun, Oct 1, 2023 at 2:36 PM djurrep @.***> wrote:

That's on Windows

Edition Windows 10 Enterprise Version 22H2 OS build 19045.3448 Experience Windows Feature Experience Pack 1000.19044.1000.0

But it works fine for me now. Mapped an IFS folder as Network-drive so that I can save the ACS scripts directly refreshing the VS code panel with a click.

— Reply to this email directly, view it on GitHub https://github.com/NielsLiisberg/vscode-ibm-i-run-sql-with-acs/issues/3#issuecomment-1742067898, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVIPHTECISZHCUAWKIRINDX5FPVNANCNFSM5P6EXRZA . You are receiving this because you commented.Message ID: @.*** com>

djurrep commented 1 year ago

Hi Niels,

File name = 'adopt authority.sql' It resides on a Windows network-drive.

Like I mentioned earlier: I can start an ACS session for the file when right-clicking on the file name in the left-panel (file-tree ) of the VS code window.

But when I select the statement in the editor panel, open the command palette and select IBM i Run SQL from ACS, I get the error:

"Command 'IBM i Run SQL from ACS' resulted in an error"

"Cannot read properties of undefined (reading 'path')"

Please don't spend too much time on this. Being able to starting ACS from the file-tree panel is just fine for me.