GithubHelp home page GithubHelp logo

Comments (9)

rosen-vladimirov avatar rosen-vladimirov commented on August 16, 2024

Hi @stephen-nba ,
You can try running your command with --log trace, for example appbuilder build android --log trace, which should give you more verbose output.
At the moment you cannot provide username and password for your proxy, but it should be sufficient just to login (in your browser or anywhere else) in your proxy.

from icenium-cli.

rosen-vladimirov avatar rosen-vladimirov commented on August 16, 2024

Also it looks like you've stuck on enabling/disabling usage reporting. You can try running:

$ appbuilder usage-reporting disable
$ appbuilder error-reporting disable

This will stop requests to our analytics server.

from icenium-cli.

stephen-nba avatar stephen-nba commented on August 16, 2024

Ironically disabling the error and usage reporting returns the very same error.

Here is the trace log, looks like it is a 501 from your server?

appbuilder build android --log trace
Exec npm -v
stdout: 3.8.6

stderr:
spawn: java "-version"
Exec node-gyp -v
stdout:
stderr: 'node-gyp' is not recognized as an internal or external command,
operable program or batch file.

Exec "adb" version
stdout: Android Debug Bridge version 1.0.32
Revision 57224c5cff69-android

stderr:
spawn: android.bat "-h"
Exec mono --version
stdout:
stderr: 'mono' is not recognized as an internal or external command,
operable program or batch file.

Exec git --version
stdout: git version 2.8.1.windows.1

stderr:
Exec gradle -v
stdout:
stderr: 'gradle' is not recognized as an internal or external command,
operable program or batch file.

Exec "javac" -version
stdout:
stderr: '"javac"' is not recognized as an internal or external command,
operable program or batch file.

System information:
{ procInfo: 'appbuilder/3.3.2',
platform: 'win32',
os: 'Windows 7 Professional 6.1.7601',
shell: 'C:\Windows\system32\cmd.exe',
dotNetVer: '4.6.01055',
procArch: 'x64',
nodeVer: 'v5.12.0',
npmVer: '3.8.6',
javaVer: '1.6.0',
nodeGypVer: null,
xcodeVer: null,
xcodeprojGemLocation: null,
itunesInstalled: true,
cocoapodVer: null,
adbVer: 'Android Debug Bridge version 1.0.32',
androidInstalled: '',
monoVer: null,
gitVer: '2.8.1.windows.1',
gradleVer: null,
javacVersion: null }
Starting watch on killswitch C:\Users[MyUser]\AppData\Local\Temp[MyUser]\Kill
Switches\cli
Looking for project in 'C:\Code[MyAppRoot]\Trunk\Mobile[MyAppName]'
Project directory is 'C:\Code[MyAppRoot]\Trunk\Mobile[MyAppName]'.
Do you want to help us improve Telerik AppBuilder by automatically sending anony
mous usage statistics? We will not use this information to identify or contact y
ou. You can read our official Privacy Policy at
? http://www.telerik.com/company/privacy-policy: No
Using proxy with host: [MyProxy], port: 8080, path is: http://registry.npmjs.
org/appbuilder
User-Agent: AppBuilderCLI/3.3.2 (Node.js 5.12.0; win32; x64)
httpRequest: { method: 'GET',
host: '[MyProxy]',
port: 8080,
path: 'http://registry.npmjs.org/appbuilder',
headers:
{ Host: 'registry.npmjs.org',
Accept: 'application/json; charset=UTF-8, /;q=0.8',
'User-Agent': 'AppBuilderCLI/3.3.2 (Node.js 5.12.0; win32; x64)',
'Accept-Encoding': 'gzip,deflate' } }
httpRequest: Sending:
[no content]
httpRequest: Done. code = 200
Using proxy with host: [MyProxy], port: 8080, path is: https://platform.teler
ik.com/appbuilder/api/rawSettings/currentUser
httpRequest: { host: '[MyProxy]',
path: 'https://platform.telerik.com/appbuilder/api/rawSettings/currentUser',
method: 'GET',
headers:
{ 'X-Icenium-SolutionSpace': 'Private_Build_Folder',
Cookie: 'tlrkappshell=[SomeCookieCode]',
Accept: 'application/octet-stream, application/json; charset=UTF-8, /;q=0
.8',
Host: 'platform.telerik.com',
'User-Agent': 'AppBuilderCLI/3.3.2 (Node.js 5.12.0; win32; x64)',
'Accept-Encoding': 'gzip,deflate' },
port: 8080 }
httpRequest: Sending:
[no content]
httpRequest: Done. code = 501
Error: The server returned unexpected response: SyntaxError: Unexpected token <
at FiberFuture.Future.wait (C:\Users[MyUser]\AppData\Roaming\npm\node_modu
les\appbuilder\node_modules\fibers\future.js:535:15)
at C:\Users[MyUser]\AppData\Roaming\npm\node_modules\appbuilder\lib\common
\errors.js:123:33
at Function.settle (C:\Users[MyUser]\AppData\Roaming\npm\node_modules\appb
uilder\node_modules\fibers\future.js:249:26)
at FiberFuture.Future.wait (C:\Users[MyUser]\AppData\Roaming\npm\node_modu
les\appbuilder\node_modules\fibers\future.js:534:10)
at C:\Users[MyUser]\AppData\Roaming\npm\node_modules\appbuilder\lib\common
\services\commands-service.js:84:106
at Function.settle (C:\Users[MyUser]\AppData\Roaming\npm\node_modules\appb
uilder\node_modules\fibers\future.js:249:26)
at FiberFuture.Future.wait (C:\Users[MyUser]\AppData\Roaming\npm\node_modu
les\appbuilder\node_modules\fibers\future.js:534:10)
at C:\Users[MyUser]\AppData\Roaming\npm\node_modules\appbuilder\lib\common
\dispatchers.js:38:85
at Function.settle (C:\Users[MyUser]\AppData\Roaming\npm\node_modules\appb
uilder\node_modules\fibers\future.js:249:26)
at FiberFuture.Future.wait (C:\Users[MyUser]\AppData\Roaming\npm\node_modu
les\appbuilder\node_modules\fibers\future.js:534:10)
at C:\Users[MyUser]\AppData\Roaming\npm\node_modules\appbuilder\lib\appbui
lder-cli.js:21:45
at C:\Users[MyUser]\AppData\Roaming\npm\node_modules\appbuilder\lib\common
\fiber-bootstrap.js:10:13
- - - - -
at IncomingMessage. (C:\Users[MyUser]\AppData\Roaming\npm\node_
modules\appbuilder\lib\common\http-client.js:120:44)
at emitNone (events.js:85:20)
at IncomingMessage.emit (events.js:179:7)
at endReadableNT (_stream_readable.js:913:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process.tickCallback (internal/process/next_tick.js:98:9)
Error reporting will be enabled. You can disable it by running '$ appbuilder err
or-reporting disable'.
Using proxy with host: [MyProxy], port: 8080, path is: https://platform.teler
ik.com/appbuilder/api/rawSettings/currentUser
httpRequest: { host: '[MyProxy]',
path: 'https://platform.telerik.com/appbuilder/api/rawSettings/currentUser',
method: 'GET',
headers:
{ 'X-Icenium-SolutionSpace': 'Private_Build_Folder',
Cookie: 'tlrkappshell=[SomeCookieCode]',
Accept: 'application/octet-stream, application/json; charset=UTF-8, /;q=0
.8',
Host: 'platform.telerik.com',
'User-Agent': 'AppBuilderCLI/3.3.2 (Node.js 5.12.0; win32; x64)',
'Accept-Encoding': 'gzip,deflate' },
port: 8080 }
httpRequest: Sending:
[no content]
httpRequest: Done. code = 501
Error: The server returned unexpected response: SyntaxError: Unexpected token <
at FiberFuture.Future.wait (C:\Users[MyUser]\AppData\Roaming\npm\node_modu
les\appbuilder\node_modules\fibers\future.js:535:15)
at C:\Users[MyUser]\AppData\Roaming\npm\node_modules\appbuilder\lib\appbui
lder-cli.js:21:45
at C:\Users[MyUser]\AppData\Roaming\npm\node_modules\appbuilder\lib\common
\fiber-bootstrap.js:10:13
- - - - -
at IncomingMessage. (C:\Users[MyUser]\AppData\Roaming\npm\node

modules\appbuilder\lib\common\http-client.js:120:44)
at emitNone (events.js:85:20)
at IncomingMessage.emit (events.js:179:7)
at endReadableNT (_stream_readable.js:913:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
Initializing analytics statuses.
Analytics statuses:
{ 'AnalyticsSettings.TrackFeatureUsage': 1,
'AnalyticsSettings.TrackExceptions': 2 }
Trying to track exception with message 'The server returned unexpected response:
SyntaxError: Unexpected token <'.

I tried setting the fiddler proxy as listed here:

https://github.com/Icenium/icenium-cli/blob/master/for-developers.md#fiddler

by creating the setting, but it didn't seem to work. Should it work in conjunction with a custom proxy?

from icenium-cli.

stephen-nba avatar stephen-nba commented on August 16, 2024

Hi guys, still getting this issue. If I go to

https://platform.telerik.com/appbuilder/api/rawSettings/currentUser/user-settings.xml

im my web browser I get

<?xml version="1.0" encoding="UTF-8"?>
<JustDevelopSettings>
<AnalyticsSettings xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<TrackExceptions>true</TrackExceptions>
<TrackFeatureUsage i:nil="true"/>
</AnalyticsSettings>
<AndroidEmulatorSettings xmlns:i="http://

etc. etc. are you sure that isn't the problem? Eg. it definately returns XML, but the error states that it is not expecting an angle bracket??

from icenium-cli.

stephen-nba avatar stephen-nba commented on August 16, 2024

And (as i'm sure you are seeing in your logs) if I run

appbuilder logout

Then

appbuilder doctor

I get

$ appbuilder doctor
WARNING: The Android SDK is not installed or is not configured properly.
You will not be able to run your apps in the native emulator. To be able to run apps
in the native Android emulator, verify that you have installed the latest Android SDK
and its dependencies as described in http://developer.android.com/sdk/index.html#Requirements

TIP: To avoid setting up the necessary environment variables, you can use the chocolatey package manager to install the Android SDK and its dependencies.

When you file an issue, these warnings will help the AppBuilder team to investigate, identify, and resolve the report.
Please, ignore them if you are not experiencing any issues with AppBuilder.

If I log in again, then run anything I get the same angle bracket error. So it is something that only happens when logged in...

from icenium-cli.

rosen-vladimirov avatar rosen-vladimirov commented on August 16, 2024

Hi @stephen-nba ,

The error SyntaxError: Unexpected token <'. indicates that result code is not success and the returned result is not JSON. It looks like this happens when CLI tries to get the logged in user from our server. In case the result is 200, the content you see in your browser ( when opening https://platform.telerik.com/appbuilder/api/rawSettings/currentUser/user-settings.xml ) will be parsed correctly. However when CLI encounters receives error code for the response (for example 500), it tries to parse the body of the response and this operation fails. In order to see the body of the response you should modify <appbuilder installation dir>/lib/common/http-client.js. Find the catch on line 198 and modify it this way:

            catch (parsingFailed) {
                console.log(body.toString());
                return "The server returned unexpected response: " + parsingFailed.toString();
            }

This way you'll see the body of the failed response. This will help us to resolve the issue, so please give it a try.

Also I would like to explain the current logic of using proxy with AppBuilder CLI. As you already know, you have to modify <appbuilder installation dir>/config/config.json file to set three properties:

	"USE_PROXY": false,
	"PROXY_HOSTNAME": "127.0.0.1",
	"PROXY_PORT": 8888,

When sending any requests, in case USE_PROXY is set to true, CLI will modify the request, so it will be passed to the proxy and the real request url will be included in the headers of the request.

When CLI makes requests to registry.npmjs.org, it uses the proxy set for npm (the result of npm config get proxy). However I believe you are not in this case as obviously you are unable to execute any command when you are logged in.

When you are not logged in, CLI does not execute the request to get the current user, that's why you are able to execute limited number of commands.

My best suggestion here is that your proxy needs authentication, but currently there's no way to authenticate your request via AppBuilder CLI. You can try the following:

  1. Open your default browser.
  2. Try authenticating in your proxy (you can ask your admins for more information on this step).
  3. Set correct proxy settings in your config.json file.
  4. Set USE_PROXY to true in the config.json
  5. Modify the code in <appbuilder installation dir>/lib/common/http-client.js as described above.
  6. Try $ appbuilder login and check the body result in case it fails again.

Hope this helps.

from icenium-cli.

stephen-nba avatar stephen-nba commented on August 16, 2024

Hi

I have modified as suggested. Here is my output, also using the debug flag:

$ appbuilder doctor
Exec npm -v
stdout: 3.10.3

stderr:
spawn: java "-version"
Exec node-gyp -v
stdout:
stderr: 'node-gyp' is not recognized as an internal or external command,
operable program or batch file.

Exec "adb" version
stdout: Android Debug Bridge version 1.0.32
Revision 57224c5cff69-android

stderr:
spawn: android.bat "-h"
Exec mono --version
stdout:
stderr: 'mono' is not recognized as an internal or external command,
operable program or batch file.

Exec git --version
stdout: git version 2.9.0.windows.1

stderr:
Exec gradle -v
stdout:
stderr: 'gradle' is not recognized as an internal or external command,
operable program or batch file.

Exec "javac" -version
stdout:
stderr: '"javac"' is not recognized as an internal or external command,
operable program or batch file.

System information:
{ procInfo: 'appbuilder/3.6.0',
platform: 'win32',
os: 'Windows 7 Professional 6.1.7601',
shell: 'C:\Windows\system32\cmd.exe',
dotNetVer: '4.6.01590',
procArch: 'ia32',
nodeVer: 'v6.3.1',
npmVer: '3.10.3',
javaVer: '1.6.0',
nodeGypVer: null,
xcodeVer: null,
xcodeprojGemLocation: null,
itunesInstalled: true,
cocoapodVer: null,
adbVer: 'Android Debug Bridge version 1.0.32',
androidInstalled: '',
monoVer: null,
gitVer: '2.9.0.windows.1',
gradleVer: null,
javacVersion: null }
Starting watch on killswitch C:\Users[MyUser]\AppData\Local\Temp\contwells\KillSwitches\cli
Looking for project in 'C:\Code[MyCodeFolder]'
Project directory is 'C:\Code[MyCodeFolder]'.
Do you want to help us improve Telerik AppBuilder by automatically sending anonymous usage statistics? We will not use this information to identify or contact you. You can read our official Privacy Policy at
? http://www.telerik.com/company/privacy-policy: Yes
Exec npm config get registry
stdout: http://registry.npmjs.org/

stderr:
Npm registry is: http://registry.npmjs.org/.
Exec npm config get proxy
stdout: http://[ProxyIp]:8080/

stderr:
Npm proxy is: { hostname: '[ProxyIp]', port: '8080' }
Using proxy with host: [ProxyIp], port: 8080, path is: http://registry.npmjs.org/appbuilder?version=latest
User-Agent: AppBuilderCLI/3.6.0 (Node.js 6.3.1; win32; ia32)
httpRequest: { host: '[ProxyIp]',
port: '8080',
path: 'http://registry.npmjs.org/appbuilder?version=latest',
headers:
{ Host: 'registry.npmjs.org',
Accept: 'application/json; charset=UTF-8, /;q=0.8',
'User-Agent': 'AppBuilderCLI/3.6.0 (Node.js 6.3.1; win32; ia32)',
'Accept-Encoding': 'gzip,deflate' } }
httpRequest: Sending:
[no content]
httpRequest: Done. code = 200
Using proxy with host: [ProxyIp], port: 8080, path is: https://platform.telerik.com/appbuilder/api/rawSettings/currentUser/user-settings.xml

httpRequest: { host: '[ProxyIp]',
path: 'https://platform.telerik.com/appbuilder/api/rawSettings/currentUser/user-settings.xml',
method: 'GET',
headers:
{ 'X-Icenium-SolutionSpace': 'Private_Build_Folder',
Cookie: 'tlrkappshell=[PrivateCookieIPresume]',
Accept: 'application/octet-stream, application/json; charset=UTF-8, /;q=0.8',
Host: 'platform.telerik.com',
'User-Agent': 'AppBuilderCLI/3.6.0 (Node.js 6.3.1; win32; ia32)',
'Accept-Encoding': 'gzip,deflate' },
port: 8080 }
httpRequest: Sending:
[no content]
httpRequest: Done. code = 501

<title>ERROR: The requested URL could not be retrieved</title> <style type="text/css" title="text/css"> html { padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px; color: #000000; padding-top: 0px; font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; height: 100% } body { padding: 20px; margin: 0px; color: #000000; padding-top: 0px; font-family: Tahoma, Verdana, Arial, Helvetica, sans-serif; font-size: 14px; height: 100% } </style>
                                            <H1>ERROR</H1>

The requested URL could not be retrieved


While trying to retrieve the URL: https://platform.telerik.com/appbuilder/api/rawSettings/currentUser/user-settings.xml

The following error was encountered:

  • Unsupported Request Method and Protocol

Squid does not support all request methods for all access protocols. For example, you can not POST a Gopher request.

Please contact your IT support desk if you believe this page has been blocked in error.
                                    </td>
                            </tr>
                    </table>
            </td>
    </tr>


Error: The server returned unexpected response: SyntaxError: Unexpected token < in JSON at position 0
at FiberFuture.Future.wait (C:\Users\contwells\AppData\Roaming\npm\node_modules\appbuilder\node_modules\fibers\future.js:566:15)
at C:\Users\contwells\AppData\Roaming\npm\node_modules\appbuilder\lib\common\errors.js:128:33
at Function.settle (C:\Users\contwells\AppData\Roaming\npm\node_modules\appbuilder\node_modules\fibers\future.js:249:26)
at FiberFuture.Future.wait (C:\Users\contwells\AppData\Roaming\npm\node_modules\appbuilder\node_modules\fibers\future.js:565:10)
at C:\Users\contwells\AppData\Roaming\npm\node_modules\appbuilder\lib\common\services\commands-service.js:84:106
at Function.settle (C:\Users\contwells\AppData\Roaming\npm\node_modules\appbuilder\node_modules\fibers\future.js:249:26)
at FiberFuture.Future.wait (C:\Users\contwells\AppData\Roaming\npm\node_modules\appbuilder\node_modules\fibers\future.js:565:10)
at C:\Users\contwells\AppData\Roaming\npm\node_modules\appbuilder\lib\common\dispatchers.js:38:85
at Function.settle (C:\Users\contwells\AppData\Roaming\npm\node_modules\appbuilder\node_modules\fibers\future.js:249:26)
at FiberFuture.Future.wait (C:\Users\contwells\AppData\Roaming\npm\node_modules\appbuilder\node_modules\fibers\future.js:565:10)
at C:\Users\contwells\AppData\Roaming\npm\node_modules\appbuilder\lib\appbuilder-cli.js:21:45
at C:\Users\contwells\AppData\Roaming\npm\node_modules\appbuilder\lib\common\fiber-bootstrap.js:10:13
- - - - -
at IncomingMessage. (C:[,...]\appbuilder\lib\common\http-client.js:115:39)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:975:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)

The main error seems to be:

"Unsupported Request Method and Protocol"

So it is definitely something with my proxy. I did a quick google and it says that Squid doesn't accept CONNECT over https? But the request is definately a GET. I don't know enough about networking to figure this one out!

If I have a good question for the IT guys I can ask, but at first glance a GET over HTTPS is supported, so there must be something else going on.

Anyway, not really an AppBuilder issue in the end, but happy for you to help!

from icenium-cli.

rosen-vladimirov avatar rosen-vladimirov commented on August 16, 2024

Hey @stephen-nba ,

It's definitely an issue with the proxy, but I'm not sure it's the configuration on your side. Maybe your IT guys have to allow access to platform.telerik.com. I've noticed that the first request that CLI executes to registry.npmjs.org is successful, but the one to platform.telerik.com is not. So there are several possible reasons for this:

  1. Your admins allow connection to registry.npmjs.org, but do not allow connection to platform.telerik.com.
  2. The proxy allows connection over http, but does not allow connection over https - from the logs I've noticed that the request to registry.npmjs.org is over http, while the request to platform.telerik.com is over https. You can try modifying the <appbuilder installation dir>/config/config.json AB_SERVER_PROTO to "http" and see if you are able to connect.
  3. The proxy configuration is different in your npm config and in AppBuilder's config. Can you verify the proxy is the same on both sides.

Hope this will give you enough information, so your admins will be able to identify the issue.

from icenium-cli.

stephen-nba avatar stephen-nba commented on August 16, 2024

Well, I got it half working. If I run Fiddler and use it as an intermediate proxy, it actually works!

I think that the issue is with a CONNECT http verb, as fiddler says

Tunnel To: platform.telerik.com:443
CONNECT platform.telerik.com:443 HTTP/1.1
Host: platform.telerik.com:443
User-Agent: AppBuilderCLI/3.6.1 (Node.js 6.3.1; win32; ia32)

I don't know what tunneling is or why it needs to do it, but it does a CONNECT which I am guessing the Squid proxy doesn't allow but somehow Fiddler helps and makes it work.

Anyway, it's not much of a solution as I can't have Fiddler running all the time when I want to use the CLI, nor can I expect the other Devs to do the same.

Maybe I'll chase down the Fiddler support guys to see why it works through Fiddler and not regularly.

Cheers!

from icenium-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.