[HostedMender] Not able to get my device appearing on hostedMender GUI

659 views
Skip to first unread message

Benoit (HTB FTR)

unread,
Mar 8, 2018, 7:41:26 AM3/8/18
to Mender List mender.io
Hello everyone,

I am trying to register a device on mender HostedServer, but despite the fact that it seems properly communicated together, my device never popup on HostedMender GUI.
I am using Mender v1.2.1 on my device , it was build againt buildroot and not Yocto. 

Here is the mender.conf file on device, and logs from mender execution which is showing a correct communication with server (double check via wireshark).
Following this stage, I was expecting hosted mender GUI to propose this device in the pending list, but, I am still waiting   .... no success for the moment....

tenant.conf has been correctly setup 


#
#
# cat /etc/mender/mender.conf
{
  "ClientProtocol": "http",
  "HttpsClient": {
    "SkipVerify": true
  },
  "RootfsPartA": "/dev/mmcblk0p8",
  "RootfsPartB": "/dev/mmcblk0p9",
  "UpdatePollIntervalSeconds": 100,
  "InventoryPollIntervalSeconds": 800,
  "RetryPollIntervalSeconds": 30,
  "ServerURL": "https://hosted.mender.io",
  "ServerCertificate": "/etc/mender/server.crt"
}
#
#
# /usr/share/mender/identity/mender-device-identity
using interface /sys/class/net/eth0
mac=e6:30:7b:26:5f:ab
#
#
#
# /usr/share/mender/inventory/mender-inventory-hostinfo
kernel=Linux version 4.4.35_hi3796mv200 (sdtv@sdtv-OptiPlex-9020) (gcc version 4.9.4 20151028 (prerelease) (gcc-linaro-4.9-2016.02 + glibc-2.25 (Build by czyong) Thu Feb 23 17:07:45 CST 2017) ) #1 SMP Tue Mar 6 11:08:51 CET 2018
mem_total_kB=1993460
hostname=buildroot
#
#
#
# /usr/share/mender/inventory/mender-inventory-network
mac_dummy0=62:26:4f:b6:f3:e2
network_interfaces=dummy0
mac_eth0=e6:30:7b:26:5f:ab
network_interfaces=eth0
ipv4_eth0=192.168.0.14/24
ipv6_eth0=2a01:e35:2ec8:c8f0:e430:7bff:fe26:5fab/64
ipv6_eth0=fe80::e430:7bff:fe26:5fab/64
#
#
#
# mender -daemon --debug
DEBU[0000] Reading Mender configuration from file /etc/mender/mender.conf  module=config
DEBU[0000] block type: RSA PRIVATE KEY                   module=keystore
WARN[0000] certificate verification skipped..            module=client
INFO[0000] State transition: init [none] -> init [none]  module=mender
DEBU[0000] no state data stored                          module=state
INFO[0000] State transition: init [none] -> idle [Idle]  module=mender
DEBU[0000] statescript: timeout for executing scripts is not defined; using default of 60 seconds  module=executor
INFO[0000] State transition: idle [Idle] -> authorize [Sync]  module=mender
DEBU[0000] statescript: timeout for executing scripts is not defined; using default of 60 seconds  module=executor
DEBU[0000] statescript: timeout for executing scripts is not defined; using default of 60 seconds  module=executor
DEBU[0000] handle authorize state                        module=state
DEBU[0000] tenant token: authtentoken                    module=auth
DEBU[0000] authorization data: {{"mac":"e6:30:7b:26:5f:ab"} authtentoken -----BEGIN PUBLIC KEY-----
MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIBigKCAYEA1pQvmQvRjN1jFXe9eXnJ
4+sXxQv+b3zw8NflmBoKIjgSAIEbjpKu7tOBKO+g/fTffhGcOPtduSQqEj7zzoM9
<...snip...>
z1DcWR44ngqgLnnnFYiAcEE4pjR8H9VkOFjCs75Opra4vt2DSEwoIW0hNsV9KPdv
5nkyWZAZPxQ7Z/BbeUpD/0967AaEO4SpdRka1Zxks6UVAgMBAAE=
-----END PUBLIC KEY-----
}  module=auth
DEBU[0000] making authorization request to server https://hosted.mender.io with req: &{POST https://hosted.mender.io/api/devices/v1/authentication/auth_requests HTTP/1.1 %!s(int=1) %!s(int=1) map[Content-Type:[application/json] Authorization:[Bearer authtentoken] X-Men-Signature:[QCXrquN1NCIW5Kb5Ty+UfTce6y8KA3TCS++uBW+gbWbU+qp9wD/8HWk+/LvyUOCGY1xbwha3OHTv2B1lpHLtigPXxQrs9JRl0UNTBPB/dUR5461q0AS0AjbUZ36GoqS0N0JWf4oAQmMiu6LdR/e1FkmPhpd8dOcctn6vbGfl4PL+LURyUgXXDkVvlzmOlHoqGdCCGfpAsl4aGsc78SPniIis30CJOkSyV5gVd6JsgCYIC2nxLvJ+PSURs/ZDC+LodRH6yAHuDCwMnagb34VZO4NOsljZq8ZaIU9Ii5bcw3XHU4+ZZkKY9XDEqQK9KtaMQwpWn2cCixnmfv/+XJu7FTALqmSUVaXKchJ8O7rUTJeFnPF0rj1Aus7ErE8SKKFAy2dJ4PfOlEjFnQLaTN63RVQsvjHpPWxl2GbuJ7RsdXo79US5SSJNU+ucv0NiNbQPBIyctw+XDh+DUWOsIGkN4/5+csPcDifT9Ng0FxXJd5wbZTdhBeD5fRuWoIYC09ku]] {{"id_data":"{\"mac\":\"e6:30:7b:26:5f:ab\"}","tenant_token":"authtentoken","pubkey":"-----BEGIN PUBLIC KEY-----\nMIIBojANBgkqhk <...snip...> gMBAAE=\n-----END PUBLIC KEY-----\n"}
} %!s(func() (io.ReadCloser, error)=0x1ddd94) %!s(int64=724) [] %!s(bool=false) hosted.mender.io map[] map[] %!s(*multipart.Form=<nil>) map[]   %!s(*tls.ConnectionState=<nil>) %!s(<-chan struct {}=<nil>) %!s(*http.Response=<nil>) <nil>}  module=client_auth
DEBU[0001] got response: &{401 Unauthorized 401 HTTP/2.0 2 0 map[Server:[openresty/1.13.6.1] Vary:[Accept-Encoding] X-Men-Requestid:[a1db6c02-ce3a-4c02-bc98-889d6f345ecd] Access-Control-Allow-Origin:[*] Date:[Thu, 08 Mar 2018 12:33:22 GMT] Content-Type:[application/json; charset=utf-8] X-Authentication-Version:[master_475a2ac76bc5492f27f53feaf2743f4d4fae7b30]] 0x10f0c010 -1 [] false false map[] 0x10f90400 0x1120faa0}  module=client_auth
ERRO[0001] authorize failed: transient error: authorization request failed: authentication request rejected  module=state
INFO[0001] State transition: authorize [Sync] -> authorize-wait [Idle]  module=mender
DEBU[0001] statescript: timeout for executing scripts is not defined; using default of 60 seconds  module=executor
DEBU[0001] statescript: timeout for executing scripts is not defined; using default of 60 seconds  module=executor
DEBU[0001] handle authorize wait state                   module=state
DEBU[0001] wait 30s before next authorization attempt    module=state


....and so on.... device never appears in the pending list on hosted.mender gui ...
....



I was looking for a way to get some informaiton from server, but no idea how to do so.
Any help on this behavior, or idea to explore, will be appreciate :-)


Thanks a lot,
Chers,
Benoît

Gregorio Di Stefano

unread,
Mar 8, 2018, 9:19:50 AM3/8/18
to Mender List mender.io
You need a valid tenant token in order to bootstrap to hosted Mender AND the token should go inside the mender.conf file.

TenantToken: "foobar",

Did you sign up for hosted Mender?

Thanks,
Greg

HTB FTR

unread,
Mar 8, 2018, 12:25:49 PM3/8/18
to men...@lists.mender.io
Ok, got it. Thanks for the tips.

Entry "TenantToken" was indeed missing in my mender.conf.
A file tenant.conf was created on the side, but, no entry inside mender.conf.

I see my device on HostedMender GUI and I am able to authorize it with the following .conf :



{
  "ClientProtocol": "http",
  "HttpsClient": {
    "SkipVerify": true
  },
  "RootfsPartA": "/dev/mmcblk0p8",
  "RootfsPartB": "/dev/mmcblk0p9",
  "UpdatePollIntervalSeconds": 100,
  "InventoryPollIntervalSeconds": 100,
  "RetryPollIntervalSeconds": 30,
  "ServerURL": "https://hosted.mender.io",
  "ServerCertificate": "/etc/mender/server.crt",
  "TenantToken": "eyJhbGciOiJS  <... snip ...> lTlIfni0LeWv"
}



Thanks Gregorio!
Cheers,
Ben


--
You received this message because you are subscribed to the Google Groups "Mender List mender.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mender+unsubscribe@lists.mender.io.
To post to this group, send email to men...@lists.mender.io.
Visit this group at https://groups.google.com/a/lists.mender.io/group/mender/.

Arun Kalmanje

unread,
Mar 30, 2018, 10:09:03 PM3/30/18
to Mender List mender.io
Hi,

Could you please provide details on how to get mender working with buildroot

Thanks
Arun

HTB FTR

unread,
Apr 4, 2018, 11:35:52 AM4/4/18
to men...@lists.mender.io
Hello Arun,

Sure. In fact, integration with buildroot was quite easy, we have integrate the following three patches on our buildroot (version 2017.11.2):



From last one, we have suppressed dependency of mender package to SystemD (useless), and we are calling mender daemon from our own startup scripts (we have slightly adapted installation procedure from buildroot mender recipe to fit our particular environment). Bring up of the solution was straight forward after that, only difficulty I got was to identify that an element of mender.conf shall link to tenant of hosted mender.conf file as in the following example :


htbftr:~/HostedMender$ cat mender.conf


{

"ClientProtocol": "http",

"HttpsClient": {

"SkipVerify": true

},

"RootfsPartA": "/dev/mmcblk0p7",

"RootfsPartB": "/dev/mmcblk0p10",

"UpdatePollIntervalSeconds": 100,

"InventoryPollIntervalSeconds": 100,

"RetryPollIntervalSeconds": 30,

"ServerURL": "https://hosted.mender.io",

"ServerCertificate": "/etc/mender/server.crt",

"TenantToken": "eyJhbGciOi <.... snip ....> 0LeWv" <- comes from HostedMender config

}


Here is another really interested link which gives some details :

Hope that it will help, let me know.


Thanks,
Benoît


--

Arun Kalmanje

unread,
Apr 4, 2018, 2:29:03 PM4/4/18
to men...@lists.mender.io
Hi,

Thanks for the patches, I did add those into my buildroot and running into some issues, 


1) BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS -- Where is this defined? Mender has a dependency on this and it never shows up in menuconfig, unless I comment this out in 

package/mender/Config.in


2) I worked around issue #1 and when it is trying to compile mender, it does not see the go binary, 

/bin/bash: /home/work/odroidc2/buildroot/output/host/bin/go: No such file or directory


In pkg-golang.mk, I changed 

GO_BIN = $(HOST_DIR)/bin/go to 

GO_BIN = $(HOST_DIR)/usr/bin/go


3) After #3, I am having different issue, when it tries to compile mender


store/dbstore.go:23:2: no buildable Go source files in /home/work/odroidc2/buildroot/output/build/mender-1.2.1/_gopath/src/github.com/mendersoftware/mender/vendor/github.com/bmatsuo/lmdb-go/lmdb



Please help out this. 


Thanks

Arun



To unsubscribe from this group and stop receiving emails from it, send an email to mender+un...@lists.mender.io.

To post to this group, send email to men...@lists.mender.io.
Visit this group at https://groups.google.com/a/lists.mender.io/group/mender/.

Arun Kalmanje

unread,
Apr 4, 2018, 4:02:21 PM4/4/18
to men...@lists.mender.io
Got compilation going through fine. Had to update to latest build root, which actually changed to latest go package. With that all the issues I mentioned is gone.

Now trying to get board communicate with hosted mender


Btw, don't we need uboot changes as in mender patches 

Thanks
Arun

Eystein Måløy Stenberg

unread,
Apr 4, 2018, 6:50:19 PM4/4/18
to men...@lists.mender.io
Hi Arun,

We did evaluate the Buildroot integration and it builds the Mender
client successfully. As we have a high bar for quality and user
experience, there are a few things we want to see before we label
buildroot as a supported platform for Mender.

This indeed includes the uboot patches, among other things.

You can see all of them enumerated here (see "Issues in Epic"):
https://tracker.mender.io/browse/MEN-1330

We are not planning to work on buildroot integration in the short term,
but of course we are very happy to help any contributions to better
support buildroot.

On 04/04/18 13:02, Arun Kalmanje wrote:
> Got compilation going through fine. Had to update to latest build root,
> which actually changed to latest go package. With that all the issues I
> mentioned is gone.
>
> Now trying to get board communicate with hosted mender
>
>
> Btw, don't we need uboot changes as in mender patches
>
> Thanks
> Arun
>
> On Wed, Apr 4, 2018 at 11:29 AM, Arun Kalmanje <akal...@gmail.com
> <mailto:akal...@gmail.com>> wrote:
>
> Hi,
>
> Thanks for the patches, I did add those into my buildroot and
> running into some issues,
>
>
> 1) BR2_PACKAGE_HOST_GO_CGO_LINKING_SUPPORTS -- Where is this
> defined? Mender has a dependency on this and it never shows up in
> menuconfig, unless I comment this out in
>
> package/mender/Config.in
>
>
> 2) I worked around issue #1 and when it is trying to compile mender,
> it does not see the go binary,
>
> /bin/bash: /home/work/odroidc2/buildroot/output/host/bin/go: No such
> file or directory
>
>
> In pkg-golang.mk <http://pkg-golang.mk>, I changed
>
> GO_BIN = $(HOST_DIR)/bin/go to
>
> GO_BIN = $(HOST_DIR)/usr/bin/go
>
>
> 3) After #3, I am having different issue, when it tries to compile
> mender
>
>
> store/dbstore.go:23:2: no buildable Go source files in
> /home/work/odroidc2/buildroot/output/build/mender-1.2.1/_gopath/src/github.com/mendersoftware/mender/vendor/github.com/bmatsuo/lmdb-go/lmdb
> <http://github.com/mendersoftware/mender/vendor/github.com/bmatsuo/lmdb-go/lmdb>
>
>
>
> Please help out this.
>
>
> Thanks
>
> Arun
>
>
>
> On Wed, Apr 4, 2018 at 8:35 AM, HTB FTR <htb...@gmail.com
> <mailto:htb...@gmail.com>> wrote:
>
> Hello Arun,
>
> Sure. In fact, integration with buildroot was quite easy, we
> have integrate the following three patches on our buildroot
> (version 2017.11.2):
>
>
> https://patchwork.ozlabs.org/cover/882836/
> <https://patchwork.ozlabs.org/cover/882836/>
> https://patchwork.ozlabs.org/patch/882835/
> <https://patchwork.ozlabs.org/patch/882835/>
> https://patchwork.ozlabs.org/patch/882842/
> ipv4_eth0=192.168.0.14/24 <http://192.168.0.14/24>
> <http://hosted.mender.io> map[] map[]
> %!s(*multipart.Form=<nil>) map[]
>  %!s(*tls.ConnectionState=<nil>) %!s(<-chan struct
> {}=<nil>) %!s(*http.Response=<nil>) <nil>}
> module=client_auth
> DEBU[0001] got response: &{401 Unauthorized 401 HTTP/2.0
> 2 0 map[Server:[openresty/1.13.6.1 <http://1.13.6.1>]
> Google Groups "Mender List mender.io <http://mender.io>" group.
> To unsubscribe from this group and stop receiving emails
> from it, send an email to mender+un...@lists.mender.io
> <mailto:mender+un...@lists.mender.io>.
> To post to this group, send email to men...@lists.mender.io
> <mailto:men...@lists.mender.io>.
> <https://groups.google.com/a/lists.mender.io/group/mender/>.
>
>
> --
> You received this message because you are subscribed to the
> Google Groups "Mender List mender.io <http://mender.io>" group.
> To unsubscribe from this group and stop receiving emails from
> it, send an email to mender+un...@lists.mender.io
> <mailto:mender+un...@lists.mender.io>.
> To post to this group, send email to men...@lists.mender.io
> <mailto:men...@lists.mender.io>.
> <https://groups.google.com/a/lists.mender.io/group/mender/>.
>
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Mender List mender.io" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to mender+un...@lists.mender.io
> <mailto:mender+un...@lists.mender.io>.
> To post to this group, send email to men...@lists.mender.io
> <mailto:men...@lists.mender.io>.
Eystein
Reply all
Reply to author
Forward
0 new messages