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

pct:run error 1144 when empty parameter passed #449

Closed
stefandrissen opened this issue May 20, 2021 · 11 comments
Closed

pct:run error 1144 when empty parameter passed #449

stefandrissen opened this issue May 20, 2021 · 11 comments

Comments

@stefandrissen
Copy link

Describe the bug
When pct:run is started with an empty parameter attribute the AVM is not started correctly and error 1444 is thrown:

[pct:run] ** Batch-mode PROGRESS requires a startup procedure. (1144)

To Reproduce

<pct:run procedure="foo.p" parameter="" />

Expected behavior
The session should start with session:parameter set to empty.

Environment

  • Windows 10
  • Progress OpenEdge 11.7.9
  • Ant 1.10.5
  • pct-215-master-cd37c2f16888207e049462f2f84f302c4680dc9b

Additional context
I was refactoring a build script in which the session parameter became optional, it is actually part of something like:

<macrodef name="foo">
   <attribute name="bar" />
   <sequential>
      <pct:run proedure="foo" parameter="@{bar}" />
   </sequential>
</macrodef>

<target name="foo">
   <foo bar="" />
</target>

<target name="foo2">
   <foo bar="2" />
</target>
@gquerret
Copy link
Contributor

I don't have access to a Windows machine this evening, but this seems to work on Linux - OE 11.7 - PCT 218. I'll test start the test suite tomorrow morning.

@gquerret
Copy link
Contributor

I've done a quick test on my desktop machine, but I still can't reproduce:

<?xml version="1.0"?>
<project name="PCTRun-test52">
  <taskdef resource="PCT.properties" />

  <target name="test">
          <PCTVersion />
          <ProgressVersion dlcHome="${DLC}" fullVersion="dlcVer" />
          <echo message="${dlcVer}" />
          <PCTRun procedure="test.p" dlcHome="${DLC}" parameter="" />
  </target>

</project>
❯ ant -lib c:\users\gquer\downloads\PCT.jar -DDLC=C:\progress\OpenEdge-11.7 -v test
Apache Ant(TM) version 1.10.5 compiled on July 10 2018
Trying the default build file: build.xml
Buildfile: C:\Users\gquer\projets\pct\testbox\PCTRun\test52\build.xml
Detected Java version: 11 in: C:\Program Files\AdoptOpenJDK\jdk-11.0.11.9-hotspot
Detected OS: Windows 10
parsing buildfile C:\Users\gquer\projets\pct\testbox\PCTRun\test52\build.xml with URI = file:/C:/Users/gquer/projets/pct/testbox/PCTRun/test52/build.xml
Project base dir set to: C:\Users\gquer\projets\pct\testbox\PCTRun\test52
parsing buildfile jar:file:/C:/Users/gquer/Downloads/apache-ant-1.10.5/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/C:/Users/gquer/Downloads/apache-ant-1.10.5/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip fileBuild sequence for target(s) `test' is [test]
Complete build sequence is [test, ]

test:
[PCTVersion] PCT Version : pct-215-master-cd37c2f16888207e049462f2f84f302c4680dc9b
[ProgressVersion] OpenEdge version found : OpenEdge Release 11.7.9 as of Fri Dec  4 19:02:04 EST 2020
[ProgressVersion] Using object : com.phenix.pct.ProgressV117
     [echo] OpenEdge Release 11.7.9 as of Fri Dec  4 19:02:04 EST 2020
   [PCTRun] OpenEdge version found : OpenEdge Release 11.7.9 as of Fri Dec  4 19:02:04 EST 2020
   [PCTRun] Using object : com.phenix.pct.ProgressV117
   [PCTRun] cpstream is not defined. You may have problems if file names have characters outside of ASCII range. You really should define it !
   [PCTRun] Current OS is Windows 10
   [PCTRun] Setting environment variable: DLC=C:\progress\OpenEdge-11.7
   [PCTRun] Executing 'C:\progress\OpenEdge-11.7\bin\_progres.exe' with arguments:
   [PCTRun] '-b'
   [PCTRun] '-q'
   [PCTRun] '-param'
   [PCTRun] ''
   [PCTRun] '-p'
   [PCTRun] 'C:\Users\gquer\AppData\Local\Temp\pctinit249664441.p'
   [PCTRun]
   [PCTRun] The ' characters around the executable and arguments are
   [PCTRun] not part of the command.
   [PCTRun] PROPATH : C:\Users\gquer\AppData\Local\Temp\pct135381310.pl,.,C:\Progress\OpenEdge-11.7\tty,C:\Progress\OpenEdge-11.7\tty\ablunit.pl,C:\Progress\OpenEdge-11.7\tty\adecomm.pl,C:\Progress\OpenEdge-11.7\tty\adecomp.pl,C:\Progress\OpenEdge-11.7\tty\adeedit.pl,C:\Progress\OpenEdge-11.7\tty\adeshar.pl,C:\Progress\OpenEdge-11.7\tty\dataadmin.pl,C:\Progress\OpenEdge-11.7\tty\OpenEdge.BusinessLogic.pl,C:\Progress\OpenEdge-11.7\tty\OpenEdge.Core.pl,C:\Progress\OpenEdge-11.7\tty\OpenEdge.ServerAdmin.pl,C:\Progress\OpenEdge-11.7\tty\prodict.pl,C:\Progress\OpenEdge-11.7,C:\Progress\OpenEdge-11.7\bin
   [PCTRun] RUN test.p
   [PCTRun] Hello
   [PCTRun] Return value : 0

BUILD SUCCESSFUL
Total time: 0 seconds

@stefandrissen
Copy link
Author

I am setting dlc_home prior to pct:run.

<pct:dlc_home value="${dlc.dir}" />

Verbose output (this time of 12.2) - I am executing Ant from PDSOE:

error:
  [pct:run] OpenEdge version found : OpenEdge Release 12.2 as of Tue Mar 17 19:02:26 EDT 2020
  [pct:run] Using object : com.phenix.pct.ProgressV121
  [pct:run] cpstream is not defined. You may have problems if file names have characters outside of ASCII range. You really should define it !
  [pct:run] Current OS is Windows 10
  [pct:run] Setting environment variable: DLC=c:\progress\oe12.2
  [pct:run] Executing 'c:\progress\oe12.2\bin\_progres.exe' with arguments:
  [pct:run] '-b'
  [pct:run] '-q'
  [pct:run] '-param'
  [pct:run] ''
  [pct:run] '-p'
  [pct:run] 'C:\Users\<user>\AppData\Local\Temp\pctinit47804196.p'
  [pct:run] 
  [pct:run] The ' characters around the executable and arguments are
  [pct:run] not part of the command.
  [pct:run] ** Batch-mode PROGRESS requires a startup procedure. (1144)

@gquerret gquerret changed the title pct:run error 1444 when empty parameter passed pct:run error 1144 when empty parameter passed May 21, 2021
@gquerret
Copy link
Contributor

Still no issue on my side. Can you execute this script:

<?xml version="1.0"?>
<project name="PCTRun-test52" xmlns:pct="antlib:eu/rssw/pct" >
  <taskdef uri="antlib:eu/rssw/pct" resource="eu/rssw/pct/antlib.xml" />
  <pct:dlc_home value="${DLC}" />

  <target name="test">
    <pct:version />
    <pct:progress_version fullVersion="dlcVer" />
    <echo message="${dlcVer}" />
    <pct:run procedure="test.p"  parameter="" />
  </target>

</project>

I'm using this command line (with PCT 215):

ant -lib c:\users\gquer\downloads\PCT.jar -DDLC=C:\progress\OpenEdge-12.2 test

And getting this output:

Buildfile: C:\Users\gquer\projets\pct\testbox\PCTRun\test52\build.xml

test:
[pct:version] PCT Version : pct-215-master-cd37c2f16888207e049462f2f84f302c4680dc9b
     [echo] OpenEdge Release 12.2.4 as of Thu Jan 21 19:01:46 EST 2021
  [pct:run] Hello

BUILD SUCCESSFUL
Total time: 0 seconds

@stefandrissen
Copy link
Author

stefandrissen commented May 21, 2021

I downloaded pct-218 just in case there was an issue with pct-215

Using 11.7:

c:\progress\oe11.7\ant\bin\ant test -lib ../other/eclipse/pct/pct-218.jar -DDLC=c:\progress\oe11.7
Unable to locate tools.jar. Expected to find it in C:\Program Files\Zulu\zulu-8-jre\lib\tools.jar
Buildfile: C:\ef\7.31\dev\ui\build.xml

test:
[pct:version] PCT Version : pct-218-master-c2ca955509da5ca57066bb168f1521aae2cf86af
     [echo] OpenEdge Release 11.7.9 as of Fri Dec  4 19:02:04 EST 2020
  [pct:run] ** Batch-mode PROGRESS requires a startup procedure. (1144)
  [pct:run] Result: 2

BUILD FAILED
C:\ef\7.31\dev\ui\build.xml:10: Progress procedure failed - Error reading return value

Total time: 0 seconds

Using 12.2:

c:\progress\oe12.2\ant\bin\ant test -lib ../other/eclipse/pct/pct-218.jar -DDLC=c:\progress\oe12.2
Unable to locate tools.jar. Expected to find it in C:\Program Files\Zulu\zulu-8-jre\lib\tools.jar
Buildfile: C:\ef\7.31\dev\ui\build.xml

test:
[pct:version] PCT Version : pct-218-master-c2ca955509da5ca57066bb168f1521aae2cf86af
     [echo] OpenEdge Release 12.2 as of Tue Mar 17 19:02:26 EDT 2020
  [pct:run] ** Batch-mode PROGRESS requires a startup procedure. (1144)

BUILD FAILED
C:\ef\7.31\dev\ui\build.xml:10: antlib:eu/rssw/pct:run returned: 2

Total time: 0 seconds

Using 12.2 with AdoptOpenJDK 11:

c:\progress\oe12.2\ant\bin\ant test -lib ../other/eclipse/pct/pct-218.jar -DDLC=c:\progress\oe12.2
Buildfile: C:\ef\7.31\dev\ui\build.xml

test:
[pct:version] PCT Version : pct-218-master-c2ca955509da5ca57066bb168f1521aae2cf86af
     [echo] OpenEdge Release 12.2 as of Tue Mar 17 19:02:26 EDT 2020
  [pct:run] ** Batch-mode PROGRESS requires a startup procedure. (1144)

BUILD FAILED
C:\ef\7.31\dev\ui\build.xml:10: antlib:eu/rssw/pct:run returned: 2

Total time: 0 seconds

Based on starting Ant with -debug, I tried the following from the command line:

c:\progress\oe12.2\bin\_progres.exe -b -param -p c:\bar.p
** Batch-mode PROGRESS requires a startup procedure. (1144)

I am unsure how the parameters are being constructed for starting _progres.exe from Java, but if there is an issue with quoting the empty string.

c:\progress\oe12.2\bin\_progres.exe -b -param "" -p c:\bar.p
** "c:\bar.p" was not found. (293)
** Unable to run startup procedure c:\bar.p. (492)

c:\progress\oe12.2\bin\_progres.exe -b -param '' -p c:\bar.p
** "c:\bar.p" was not found. (293)
** Unable to run startup procedure c:\bar.p. (492)

Vaguely somewhere a bell is ringing with how cmd deals with quotes.

@bulagump
Copy link

@stefandrissen , The error "** Batch-mode PROGRESS requires a startup procedure. (1144)" is expected with a compile time license. Please check the license of the version of Progress you are running.

https://knowledgebase.progress.com/articles/Article/20710
https://knowledgebase.progress.com/articles/Knowledge/P133871

@stefandrissen
Copy link
Author

stefandrissen commented May 22, 2021

@stefandrissen , The error "** Batch-mode PROGRESS requires a startup procedure. (1144)" is expected with a compile time license. Please check the license of the version of Progress you are running.

https://knowledgebase.progress.com/articles/Article/20710
https://knowledgebase.progress.com/articles/Knowledge/P133871

The problem is not the license, I "obviously" have a development license, the problem is an empty parameter swallowing -p when Java exec invokes _progres.exe.

If I change parameter to a space, the 1144 error also no longer occurs. If I start a test.p that waits for 20 seconds I can see that the command line in task manager is - pay attention to the quotes:

"c:\progress\oe12.2\bin\_progres.exe" -b -q -param " " -p C:\users<user>\AppData\Local\Temp\pctinit#.p

When parameter is not part of the run:

"c:\progress\oe12.2\bin\_progres.exe" -b -q -p C:\users<user>\AppData\Local\Temp\pctinit#.p

Unfortunately I am unable to grab what is trying to be started when parameter is set to empty, but based on what I am seeing, I can only guess that it is:

"c:\progress\oe12.2\bin\_progres.exe" -b -q -param -p C:\users<user>\AppData\Local\Temp\pctinit#.p

Resulting in -p being swallowed by -param, which should be easy to reproduce, but for some reason isn't .

@gquerret
Copy link
Contributor

There are various articles about how turning on a debugger can prevent bugs during a debugging session, but here this is coming from the profiler. All PCT test cases are running with profiler activated (in order to get code coverage in SonarQube), and the bug is not there when profiler is activated.

Running C:\Progress\OPENED~1.2\bin\_progres.exe -b -q -param -profile C:\Users\gquer\AppData\Local\Temp\prof.pf -p C:\Users\gquer\AppData\Local\Temp\pctinit.p is perfectly fine.

At least, I can reproduce the issue.

@gquerret
Copy link
Contributor

@stefandrissen , The error "** Batch-mode PROGRESS requires a startup procedure. (1144)" is expected with a compile time license. Please check the license of the version of Progress you are running.

I have to admit that it was my initial idea too, though I'm almost sure that you know what you're talking about when opening this kind of issue :-)

@stefandrissen
Copy link
Author

Running C:\Progress\OPENED~1.2\bin\_progres.exe -b -q -param -profile C:\Users\gquer\AppData\Local\Temp\prof.pf -p C:\Users\gquer\AppData\Local\Temp\pctinit.p is perfectly fine.

Perfectly is not entirely true. Your -profile is swallowed by -param, so that case is not profiling. If you run the above without -b you will see prof.pf opened in the editor after executing pctinit.p

@gquerret
Copy link
Contributor

Fixed in master

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants