Community
cancel
Showing results for 
Search instead for 
Did you mean: 
AAlex19
Novice
1,895 Views

edison config http server not running (crashing on request) in 3.5 release

1. flashed iot-devkit-prof-dev-image-edison-20160606

2. configured via configure_edison --setup

3. netstat -tnpl

Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name

tcp 0 0 0.0.0.0:1883 0.0.0.0:* LISTEN 262/mosquitto

tcp 0 0 127.0.0.1:58888 0.0.0.0:* LISTEN 640/node

tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 326/redis-server

tcp6 0 0 :::1883 :::* LISTEN 262/mosquitto

tcp6 0 0 :::80 :::* LISTEN 948/node

tcp6 0 0 :::22 :::* LISTEN 1/init

4. checked if service is up systemctl status edison_config.service -l

it said it was running but only since a few secs

5. made a http get request!

6. took a closer look journalctl -fu edison_config.service

Aug 03 14:53:53 Blueway su[976]: Successful su for root by root Aug 03 14:53:53 Blueway su[976]: + ??? root:root Aug 03 14:53:53 Blueway su[976]: pam_unix(su:session): session opened for user root by (uid=0) Aug 03 14:55:21 Blueway su[976]: at Server.requestHandler (/usr/lib/edison_config_tools/edison-config-server.js:361:8) Aug 03 14:55:21 Blueway su[976]: at emitTwo (events.js:87:13) Aug 03 14:55:21 Blueway su[976]: at Server.emit (events.js:172:7) Aug 03 14:55:21 Blueway su[976]: at HTTPParser.parserOnIncoming [as onIncoming] (_http_server.js:528:12) Aug 03 14:55:21 Blueway su[976]: at HTTPParser.parserOnHeadersComplete (_http_common.js:103:23) Aug 03 14:55:21 Blueway systemd[1]: edison_config.service: main process exited, code=exited, status=1/FAILURE Aug 03 14:55:21 Blueway systemd[1]: Unit edison_config.service entered failed state.
8 Replies
idata
Community Manager
185 Views

Hello Booker_B,

 

 

I just tried the steps you posted above, yet the output I receive in the Edison's journal is different from what you receive. This is my output:

 

 

-- Logs begin at Sat 2000-01-01 00:00:11 UTC. --

 

Jul 29 22:07:40 Peter systemd[1]: Starting The Edison status and configuration service...

 

Jul 29 22:07:40 Peter systemd[1]: Started The Edison status and configuration service.

 

Jul 29 22:07:40 Peter su[297]: Successful su for root by root

 

Jul 29 22:07:40 Peter su[297]: + ??? root:root

 

Jul 29 22:07:40 Peter su[297]: pam_unix(su:session): session opened for user root by (uid=0)

 

 

I'm not sure what the issue you are getting is. Could you please explain us a little bit more about what you're doing?

 

-Peter.
AAlex19
Novice
185 Views

are u sure that u did step 5. ?

when u access it u should get a website showing u the ip, hostname ,and more stuff.

/usr/lib/edison_config_tools/edison-config-server.js

is a http server at port 80, made by intel.

It just crashes at me, everytime i make a request.

curl 192.168.5.62:80

curl: (52) Empty reply from server

normaly u should get the config website from intel.

I just use the 3.5 image.

idata
Community Manager
185 Views

Indeed I made http get request but for the purpose of the test I used Google instead. This is my output:

 

 

root@edison:~# netstat -tnpl

 

Active Internet connections (only servers)

 

Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name

 

tcp 0 0 0.0.0.0:1883 0.0.0.0:* LISTEN 283/mosquitto

 

tcp 0 0 127.0.0.1:58888 0.0.0.0:* LISTEN 342/node

 

tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 360/redis-server

 

tcp6 0 0 :::1883 :::* LISTEN 283/mosquitto

 

tcp6 0 0 :::80 :::* LISTEN 310/node

 

tcp6 0 0 :::22 :::* LISTEN 1/init

 

root@edison:~# systemctl status edison_config.service -l

 

● edison_config.service - The Edison status and configuration service

 

Loaded: loaded (/lib/systemd/system/edison_config.service; enabled)

 

Active: active (running) since Fri 2016-08-05 16:18:16 UTC; 16min ago

 

Main PID: 290 (su)

 

CGroup: /system.slice/edison_config.service

 

‣ 290 /bin/su root -c node /usr/lib/edison_config_tools/edison-config-server.js

 

 

Aug 05 16:18:16 edison systemd[1]: Started The Edison status and configuration service.

 

Aug 05 16:18:16 edison su[290]: Successful su for root by root

 

Aug 05 16:18:16 edison su[290]: + ??? root:root

 

Aug 05 16:18:16 edison su[290]: pam_unix(su:session): session opened for user root by (uid=0)

 

root@edison:~# curl 10.54.90.38

 

curl: (7) Failed to connect to 10.54.90.38 port 80: Connection refused

 

root@edison:~# curl 10.54.90.38:80

 

curl: (7) Failed to connect to 10.54.90.38 port 80: Connection refused

 

root@edison:~# curl www.google.com

 

 

***I did receive the the config from www.google.com but I won't paste it here as it is very long.

 

 

root@edison:~# journalctl -fu edison_config.service

 

-- Logs begin at Fri 2016-08-05 16:18:08 UTC. --

 

Aug 05 16:18:16 edison systemd[1]: Starting The Edison status and configuration service...

 

Aug 05 16:18:16 edison systemd[1]: Started The Edison status and configuration service.

 

Aug 05 16:18:16 edison su[290]: Successful su for root by root

 

Aug 05 16:18:16 edison su[290]: + ??? root:root

 

Aug 05 16:18:16 edison su[290]: pam_unix(su:session): session opened for user root by (uid=0)

 

 

Do you have the same behavior with www.google.com or does it throw the same error as when using 192.168.5.62:80?

 

-Peter.
AAlex19
Novice
185 Views

i dont know what google has to do with the local config:P

use the ip of the edison, to find it out:

ip -4 addr show wlan0 | grep 'inet' | awk '{print $2}' | awk -F/ '{print $1}

use this ip for curl, this is ur local ip of the edison, now u make the request via curl or whatever to THIS ip.

a curl to localhost:80 when u r on the edison cli should do it too

idata
Community Manager
185 Views

Hi Booker_B,

 

 

Thanks for letting me know how to replicate the issue. I am now able to replicate it. This is my output:

 

 

-- Logs begin at Sat 2000-01-01 00:00:11 UTC. --

 

Aug 04 14:34:45 Peter su[296]: pam_unix(su:session): session opened for user root by (uid=0)

 

Aug 08 15:56:18 Peter systemd[1]: edison_config.service: main process exited, code=exited, status=1/FAILURE

 

Aug 08 15:56:18 Peter systemd[1]: Unit edison_config.service entered failed state.

 

Aug 08 15:56:28 Peter systemd[1]: edison_config.service holdoff time over, scheduling restart.

 

Aug 08 15:56:28 Peter systemd[1]: Stopping The Edison status and configuration service...

 

Aug 08 15:56:28 Peter systemd[1]: Starting The Edison status and configuration service...

 

Aug 08 15:56:28 Peter systemd[1]: Started The Edison status and configuration service.

 

Aug 08 15:56:28 Peter su[468]: Successful su for root by root

 

Aug 08 15:56:28 Peter su[468]: + ??? root:root

 

Aug 08 15:56:28 Peter su[468]: pam_unix(su:session): session opened for user root by (uid=0)

 

 

Let me investigate what might be happening. If I find out anything useful I'll post it here.

 

-Peter.
idata
Community Manager
185 Views

Hi Booker_B,

 

 

We're sorry for the delay in our response. We have an update on this.

 

 

We've been informed that this issue is in consideration for a future release of Edison software. Hopefully it will be released soon, nevertheless, there no ETA for it.

 

 

-Peter.
DDaz
Novice
185 Views

I repro this too.

The error appears to result from a change in shelljs http://documentup.com/shelljs/shelljs# execcommand--options--callback exec command.

edison-config-server.js calls shelljs 'exec' 3 times and expects the result to include an 'output' property. This property does not exist on the response. 'output' is replaced by 'stdout'.

I replaced the 3 occurrences of result.output in /usr/lib/edison_config_tools/edison-config-server.js with result.stdout and am now able to browse the device information

349: if ((result.code != 0) || (result.stdout.trim() != "Master")) {

377: if ((result.code != 0) || (result.stdout.trim() != "Master")) {

439: if ((result.code != 0) || (result.stdout.trim() === "True")) {

Then:

systemctl restart edison_config

Then retry browsing the endpoint.

DDaz
Novice
185 Views

https://github.com/shelljs/shelljs/wiki/Migrating-from-v0.5.3-to-v0.6 shelljs/shelljs Wiki --Migrating from v0.5.3 to v0.6

  • Deprecated: exec() used to return an object that looks like {code: ..., output: ...}. It now returns an object that looks like {code: ..., stdout: ..., stderr: ..., output: ...}. The .output attribute is deprecated.
Reply