browserup / browserup-proxy

BrowserUp Proxy is a free utility to watch, test, and manipulate web application network traffic and performance.
https://browserup.com
Apache License 2.0
163 stars 42 forks source link

browserup-proxy.bat throws "The input line is too long." error #275

Open weendigo opened 4 years ago

weendigo commented 4 years ago

Describe the bug Unable to start BUP 2.1.0 or 2.1.1 using browserup-proxy.bat.

Using Powershell and cmd exhibits the same behavior:

PS D:\Program Files\bup\browserup-proxy-2.1.1-SNAPSHOT\bin> .\browserup-proxy.bat The input line is too long. The syntax of the command is incorrect.

To Reproduce Steps to reproduce the behavior:

  1. Download 2.1.0 or 2.1.1 release zip
  2. Unzip
  3. Go to ...\browserup-proxy-2.1.1-SNAPSHOT\bin folder
  4. Try to launch browserup-proxy.bat
  5. Proxy not started, error shown instead

Expected behavior BUP should start.

Please complete the following information:

Additional context Not reproducible with version 2.0.1.

ericbeland commented 4 years ago

We don't have a windows machine for testing this available at the moment, however, there are some stack overflow cases where this type of error happens when the PATH variable has been polluted accidentally. Can you check on your path variable? What if you manually edit the batch file(save a copy)--can you make it so it works?

https://stackoverflow.com/questions/16821784/input-line-is-too-long-error-in-bat-file

erickubenka commented 4 years ago

I can confirm this issue using the bin/browserup-proxy.bat-File. Error is line 85

set CLASSPATH=%APP_HOME%\lib\browserup-proxy-dist-2.1.1-SNAPSHOT.jar;%APP_HOME%\lib\browserup-proxy-rest-2.1.1-SNAPSHOT.jar;%APP_HOME%\lib\browserup-proxy-core-2.1.1-SNAPSHOT.jar;%APP_HOME%\lib\sitebricks-0.8.11.jar;%APP_HOME%\lib\jersey-media-json-jackson-2.31.jar;%APP_HOME%\lib\swagger-jaxrs2-2.1.2.jar;%APP_HOME%\lib\swagger-integration-2.1.2.jar;%APP_HOME%\lib\swagger-core-2.1.2.jar;%APP_HOME%\lib\sitebricks-client-0.8.11.jar;%APP_HOME%\lib\sitebricks-converter-0.8.11.jar;%APP_HOME%\lib\jackson-jaxrs-json-provider-2.10.1.jar;%APP_HOME%\lib\jackson-module-jaxb-annotations-2.10.1.jar;%APP_HOME%\lib\jackson-datatype-jsr310-2.10.1.jar;%APP_HOME%\lib\jackson-jaxrs-base-2.10.1.jar;%APP_HOME%\lib\jackson-databind-2.10.3.jar;%APP_HOME%\lib\swagger-models-2.1.2.jar;%APP_HOME%\lib\jackson-annotations-2.10.3.jar;%APP_HOME%\lib\jackson-dataformat-yaml-2.10.3.jar;%APP_HOME%\lib\jackson-core-2.10.3.jar;%APP_HOME%\lib\guice-servlet-4.2.3.jar;%APP_HOME%\lib\guice-multibindings-4.2.3.jar;%APP_HOME%\lib\guice-4.2.3.jar;%APP_HOME%\lib\browserup-proxy-mitm-2.1.1-SNAPSHOT.jar;%APP_HOME%\lib\netty-all-4.1.50.Final.jar;%APP_HOME%\lib\log4j-slf4j-impl-2.13.1.jar;%APP_HOME%\lib\log4j-core-2.13.1.jar;%APP_HOME%\lib\log4j-api-2.13.1.jar;%APP_HOME%\lib\jetty-servlet-9.4.29.v20200521.jar;%APP_HOME%\lib\jetty-security-9.4.29.v20200521.jar;%APP_HOME%\lib\jetty-server-9.4.29.v20200521.jar;%APP_HOME%\lib\jersey-hk2-2.31.jar;%APP_HOME%\lib\javassist-3.27.0-GA.jar;%APP_HOME%\lib\netty-codec-4.1.50.Final.jar;%APP_HOME%\lib\littleproxy-2.0.0-beta-5.jar;%APP_HOME%\lib\jaxb-api-2.3.1.jar;%APP_HOME%\lib\guava-28.2-jre.jar;%APP_HOME%\lib\jzlib-1.1.3.jar;%APP_HOME%\lib\dnsjava-3.1.0.jar;%APP_HOME%\lib\bcpkix-jdk15on-1.64.jar;%APP_HOME%\lib\bcprov-jdk15on-1.64.jar;%APP_HOME%\lib\dec-0.1.2.jar;%APP_HOME%\lib\selenium-api-3.141.59.jar;%APP_HOME%\lib\jcl-over-slf4j-1.7.30.jar;%APP_HOME%\lib\async-http-client-1.6.3.jar;%APP_HOME%\lib\slf4j-api-1.7.30.jar;%APP_HOME%\lib\jopt-simple-5.0.4.jar;%APP_HOME%\lib\commons-lang3-3.10.jar;%APP_HOME%\lib\jersey-container-servlet-core-2.31.jar;%APP_HOME%\lib\jersey-bean-validation-2.31.jar;%APP_HOME%\lib\swagger-jaxrs2-servlet-initializer-2.1.2.jar;%APP_HOME%\lib\snakeyaml-1.24.jar;%APP_HOME%\lib\javax.inject-1.jar;%APP_HOME%\lib\aopalliance-1.0.jar;%APP_HOME%\lib\sitebricks-annotations-0.8.11.jar;%APP_HOME%\lib\mvel2-2.1.3.Final.jar;%APP_HOME%\lib\jcip-annotations-1.0.jar;%APP_HOME%\lib\annotations-7.0.3.jar;%APP_HOME%\lib\jsoup-1.8.1.jar;%APP_HOME%\lib\javax.servlet-api-3.1.0.jar;%APP_HOME%\lib\jetty-http-9.4.29.v20200521.jar;%APP_HOME%\lib\jetty-io-9.4.29.v20200521.jar;%APP_HOME%\lib\netty-transport-4.1.50.Final.jar;%APP_HOME%\lib\netty-buffer-4.1.50.Final.jar;%APP_HOME%\lib\netty-resolver-4.1.50.Final.jar;%APP_HOME%\lib\netty-common-4.1.50.Final.jar;%APP_HOME%\lib\barchart-udt-bundle-2.3.0.jar;%APP_HOME%\lib\javax.activation-api-1.2.0.jar;%APP_HOME%\lib\failureaccess-1.0.1.jar;%APP_HOME%\lib\listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar;%APP_HOME%\lib\jsr305-3.0.2.jar;%APP_HOME%\lib\checker-qual-2.10.0.jar;%APP_HOME%\lib\error_prone_annotations-2.3.4.jar;%APP_HOME%\lib\j2objc-annotations-1.3.jar;%APP_HOME%\lib\jersey-server-2.31.jar;%APP_HOME%\lib\jersey-client-2.31.jar;%APP_HOME%\lib\jersey-media-jaxb-2.31.jar;%APP_HOME%\lib\jersey-common-2.31.jar;%APP_HOME%\lib\hk2-locator-2.6.1.jar;%APP_HOME%\lib\hk2-api-2.6.1.jar;%APP_HOME%\lib\hk2-utils-2.6.1.jar;%APP_HOME%\lib\jakarta.inject-2.6.1.jar;%APP_HOME%\lib\jersey-entity-filtering-2.31.jar;%APP_HOME%\lib\jakarta.ws.rs-api-2.1.6.jar;%APP_HOME%\lib\hibernate-validator-6.1.2.Final.jar;%APP_HOME%\lib\jakarta.validation-api-2.0.2.jar;%APP_HOME%\lib\jakarta.el-api-3.0.3.jar;%APP_HOME%\lib\jakarta.el-3.0.3.jar;%APP_HOME%\lib\classgraph-4.8.65.jar;%APP_HOME%\lib\swagger-annotations-2.1.2.jar;%APP_HOME%\lib\jakarta.xml.bind-api-2.3.2.jar;%APP_HOME%\lib\xstream-1.3.1.jar;%APP_HOME%\lib\jetty-util-9.4.29.v20200521.jar;%APP_HOME%\lib\jakarta.annotation-api-1.3.5.jar;%APP_HOME%\lib\osgi-resource-locator-1.0.3.jar;%APP_HOME%\lib\jakarta.activation-api-1.2.1.jar;%APP_HOME%\lib\aopalliance-repackaged-2.6.1.jar;%APP_HOME%\lib\jboss-logging-3.3.2.Final.jar;%APP_HOME%\lib\classmate-1.3.4.jar;%APP_HOME%\lib\xpp3_min-1.1.4c.jar

This command is too long for windows command line, because limits are 2047, respectively 8191 characters, depending on operating system. See: https://support.microsoft.com/de-de/help/830473.

Further this will lead to an error on line 89, where this vairable CLASSPATH will be used to start browserup proxy.

To workaround this problem use a shell/bash like Git Bash, Windows Subsystem for Linux (WSL) or cygwin to execute the browserup-proxy instead of browserup-proxy.bat.