Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pgAgent Job: Issue with windows batch (exe application+ arguments): command arguements not supported #7430

Closed
rdczhzq opened this issue Apr 26, 2024 · 19 comments
Assignees
Labels

Comments

@rdczhzq
Copy link

rdczhzq commented Apr 26, 2024

i,pgadmin-hackers.

I am using pgagent(edb_pgagent_pg16.exe) to config job for custom application (.exe) with arguments.

The problem I encountered if I add command parameters as showed below, I got result with "r"

image

but if I run the test.exxe without the parameters, the result is "s".

image

I am wondering if the pgagent batch scripts doesn't support run exe with parameters? How shall I workaroud this problem.

Looking foward to your reply.

@adityatoshniwal
Copy link
Contributor

Can you check the pgAgent logs why it is failing? BTW, r is for running.

@rdczhzq
Copy link
Author

rdczhzq commented Apr 26, 2024 via email

@akshay-joshi
Copy link
Contributor

@rdczhzq

I've tested pgAgent in DEBUG mode on Windows but could not replicate the reported issue. To validate its functionality, I executed the following test scenario:

Scenario 1: Open a file using Notepad as a job step of pgAgent.

notepad_example_new.mov

Scenario 2: Run a Python program to add two numbers and save the output in the file.

python_program_new.mp4

Can you please try the notepad example?

@rdczhzq
Copy link
Author

rdczhzq commented May 15, 2024 via email

@rdczhzq
Copy link
Author

rdczhzq commented May 15, 2024 via email

@rdczhzq rdczhzq removed their assignment May 16, 2024
@rdczhzq
Copy link
Author

rdczhzq commented May 16, 2024

As the issue can reproduce here (with more steplog information(null result)), I suggest this issue still needs to be investigated.

if you need more logs, i can do a data collection. If needed, a Lync session can be arranged to show you how the issue reproduce here.

@akshay-joshi
Copy link
Contributor

akshay-joshi commented May 16, 2024

@rdczhzq

Do one thing stop the pgAgent service, get the path of the binary file and run from command line using "DEBUG -l 2 host=xx port=xx dbname=xx" parameters? OR

Setup a zoom session any time between 10am to 6pm IST(GMT + 5:30) tomorrow.

@akshay-joshi
Copy link
Contributor

@rdczhzq

Could you please verify one more scenario? Run the command 'c:\release\test.exe measurement 4 20' from the command prompt and confirm if the execution has been completed

@rdczhzq
Copy link
Author

rdczhzq commented May 17, 2024 via email

@rdczhzq
Copy link
Author

rdczhzq commented May 17, 2024 via email

@rdczhzq
Copy link
Author

rdczhzq commented May 17, 2024 via email

@rdczhzq
Copy link
Author

rdczhzq commented May 17, 2024 via email

@rdczhzq
Copy link
Author

rdczhzq commented May 17, 2024 via email

@akshay-joshi
Copy link
Contributor

@rdczhzq

Another option could be Google Meet.

@rdczhzq
Copy link
Author

rdczhzq commented May 17, 2024 via email

@akshay-joshi
Copy link
Contributor

@rdczhzq

You can set up a meeting where I can join using browser, there is no restriction at our end

@rdczhzq
Copy link
Author

rdczhzq commented May 17, 2024 via email

@rdczhzq
Copy link
Author

rdczhzq commented May 22, 2024

Put this on hold until the following happens:

  1. A join troubleshooting between Akshay and me is arranged as we google, zoom are not feasible.
  2. A fresh new installation of postgresql is ready for a new test.

@rdczhzq
Copy link
Author

rdczhzq commented May 23, 2024

Close the issue. When I rewrote the program without reading Console input as following. This feature works.

Console.CancelKeyPress += new ConsoleCancelEventHandler(CancelKeyPressHandler);
ConsoleKeyInfo keyInfo = Console.ReadKey(true);
if (keyInfo.Key.HasFlag(ConsoleKey.Escape))
{ }

image
image
image

There's one outstanding issue,however I would like to take it seperately.

  1. notepad.exe is not schedulded in the pgagnet job. Is there any configuration to be done so that the windows service can interact with the desktop, I assume the service is not able to interact with desktop by default?

@rdczhzq rdczhzq closed this as completed May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants