Command not Found issue

Hello Drew,

./scripts/bootstrap-rootfs-overlay-demo.sh --output-dir ~/mender-convert/output

after this command i am getting an error like "sudo: ./scripts/bootstrap-rootfs-overlay-demo.sh: command not found " can you look this and give me some suggestion.

this command i am running in my SD card ROOFS/mender-converter: folder. here its not running, but if i run the same command outside then its running smoothly. i am not getting why?

It is not clear to me where you are running this command? It should be run in the root directory of mender-convert directory.

And should create the following layout:

~/mender-convert$ tree rootfs_overlay_demo/
rootfs_overlay_demo/
└── etc
    └── mender
        └── mender.conf

2 directories, 1 file

During the image conversion process the rootfs_overlay_demo directory will be installed on the target root filesystem and the resulting images from mender-convert should have the content specific in rootfs_overlay_demo.

Hello,

The following steps should be run as the initial setup:
git clone -b next git@github.com:mendersoftware/mender-convert.git cd mender-convert
mkdir input => Place appropriate BBB/Debian image in input/ directory ./scripts/bootstrap-rootfs-overlay-demo.sh --output-dir
{PWD}/rootfs_overlay_demo --tenant-token "<Paste token from Hosted Mender>" ./docker-build

this are the initial commands i should run in the “/media/anil/ROOTFS” SD card which i will put later into the BBB. so if i run 1st cloning command itself i am getting error like

anil@ubuntu-anil-pc:/media/anil/ROOTFS$ sudo git clone -b next https://github.com/mendersoftware/mender-convert.git
[sudo] password for anil:
Cloning into ‘mender-convert’…
remote: Enumerating objects: 4, done.
remote: Counting objects: 100% (4/4), done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 902 (delta 0), reused 1 (delta 0), pack-reused 898
Receiving objects: 100% (902/902), 612.94 KiB | 575.00 KiB/s, done.
Resolving deltas: 100% (534/534), done.
fatal: fsync error on ‘/media/anil/ROOTFS/mender-convert/.git/objects/pack/tmp_idx_CtViV0’: Input/output error
fatal: index-pack failed

so can you tell me what i have to do?

so if i run 1st cloning command itself i am getting error like
anil@ubuntu-anil-pc:/media/anil/ROOTFS$ sudo git clone -b next

Do not use sudo in the git clone command.

and the sequence of commands are:

git clone https://github.com/mendersoftware/mender-convert.git -b next
cd mender-convert/
mkdir input && cd input
wget https://downloads.raspberrypi.org/raspbian_lite/images/raspbian_lite-2019-06-24/2019-06-20-raspbian-buster-lite.zip
unzip 2019-06-20-raspbian-buster-lite.zip && cd ..
./scripts/bootstrap-rootfs-overlay-demo.sh \
    --output-dir ${PWD}/rootfs_overlay_demo \
    --tenant-token "Paste token from Hosted Mender"
./docker-build
MENDER_ARTIFACT_NAME=release-1 ./docker-mender-convert \
    --disk-image input/2019-06-20-raspbian-buster-lite.img \
    --config configs/raspberrypi3_config \
    --overlay rootfs_overlay_demo/

You would need to replace the bits which are BBB specific (I used RPi3 in above example)

i am able to run all commands now,

but now i would like to deploy my image into the SD card so i tried this

anil@ubuntu-anil-pc:/media/anil/mender-convert$ sudo dd if=deploy/beaglebone-sdcard-Nestle_Ver3.0.0.sdimg o f=/dev/mmcblk0p1 bs=8000 conv=fdatasync
[sudo] password for anil:
dd: fdatasync failed for ‘/dev/mmcblk0p1’: Input/output error
1072168+1 records in
1072168+1 records out
8577351680 bytes (8.6 GB, 8.0 GiB) copied, 1315.71 s, 6.5 MB/s
anil@ubuntu-anil-pc:/media/anil/mender-convert$ sudo dd if=deploy/beaglebone-sdcard-Nestle_Ver3.0.0.sdimg of=/dev/mmcblk0 bs=8000 conv=fdatasync
[sudo] password for anil:
dd: fdatasync failed for ‘/dev/mmcblk0’: Input/output error
1072168+1 records in
1072168+1 records out
8577351680 bytes (8.6 GB, 8.0 GiB) copied, 1402.51 s, 6.1 MB/s
anil@ubuntu-anil-pc:/media/anil/mender-convert$ sudo dd if=deploy/beaglebone-sdcard-Nestle_Ver3.0.0.sdimg of=/dev/mmcblk0 conv=fdatasync
[sudo] password for anil:

see this errors. i am trying to deploy the image into the SD card which is connected to PC. See the Attached image for this. Am i doing something wrong here?

I realize we discussed this in email but I’ll follow up here in case the response is helpful to others.

You definitely want to use the “of=/dev/mmcblk0” form rather than the “of=/dev/mmcblk0p1”.

Also, I think you should use “bs=8mb” instead of “bs=8000”. I think it will use blocks of 8000 bytes with the latter which is an odd block size and will likely be fairly slow.

Interestingly the error here seems specifically related to the “conv=fdatasync” parameter so you may just drop that from the command to see if it helps. In that case, make sure to run “sync” from your command prompt after the dd command and before ejecting the SD Card.

yes Drew,

i finished all those things and i can run the client now.
But there i am running the logs of mender , so i am getting authentication error

debian@beaglebone:/etc$ sudo journalctl -u mender --follow
[sudo] password for debian:
– Logs begin at Thu 2016-11-03 17:16:43 UTC. –
Oct 11 07:33:12 beaglebone mender[313]: level=error msg=“authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: Unauthorized” module=state
Oct 11 07:33:12 beaglebone mender[313]: time=“2019-10-11T07:33:12Z” level=error msg=“authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: Unauthorized” module=state
Oct 11 07:33:12 beaglebone mender[313]: level=info msg=“State transition: authorize [Sync] -> authorize-wait [Idle]” module=mender
Oct 11 07:33:12 beaglebone mender[313]: time=“2019-10-11T07:33:12Z” level=info msg=“State transition: authorize [Sync] -> authorize-wait [Idle]” module=mender
Oct 11 07:38:10 beaglebone mender[313]: level=info msg=“State transition: authorize-wait [Idle] -> authorize [Sync]” module=mender
Oct 11 07:38:10 beaglebone mender[313]: time=“2019-10-11T07:38:10Z” level=info msg=“State transition: authorize-wait [Idle] -> authorize [Sync]” module=mender
Oct 11 07:38:12 beaglebone mender[313]: level=error msg=“authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: Unauthorized” module=state
Oct 11 07:38:12 beaglebone mender[313]: time=“2019-10-11T07:38:12Z” level=error msg=“authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: Unauthorized” module=state
Oct 11 07:38:12 beaglebone mender[313]: level=info msg=“State transition: authorize [Sync] -> authorize-wait [Idle]” module=mender
Oct 11 07:38:12 beaglebone mender[313]: time=“2019-10-11T07:38:12Z” level=info msg=“State transition: authorize [Sync] -> authorize-wait [Idle]” module=mender

see this logs. and one more doubt is that while running the

here you mentioned that i should run this command

**./scripts/bootstrap-rootfs-overlay-demo.sh --output-dir ~/mender-convert/output**

i am not getting the meaning of this command.
and i changed the

in Home/mender-conver/rootfs_overlay_demo/etc/mender/mender.conf

{
"InventoryPollIntervalSeconds": 5,
"RetryPollIntervalSeconds": 30,
"ServerURL": “https://localhost/”,
"UpdatePollIntervalSeconds": 5
}

this settings. is this right or something wrong i did?

ServerURL needs to specific a valid server URL. Which server do you intend to use?

Please check the Mender client configuration options to better understand the mender.conf file content.

https://docs.mender.io/2.1/client-configuration/configuration-file/configuration-options

Hello mirzak,

https://docs.mender.io/2.1/getting-started/create-a-test-environment

this document i followed to create my own server. I given login ID and PWD and then going to local host and login there.
and by using
sudo ./up i am running my server.

so that i kept “ServerURL”: “https://localhost/”,

is this correct?

I do not think so. localhost refers to your PC as I assume that you are not running the demo server on the device.

What you typically do in this case is set the ServerURL to the following:

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

And then update the /etc/hosts with the following:

< IP address of the PC which is running the demo server > docker.mender.io s3.docker.mender.io

Yes mirzak,

sorry my mistake,
Actually i am running a demo server only,not a hosted mender (Which is paid - i have to given credit /debit card details)
I am running a demo server now.
So how many changes i have to make in the programming while doing all the process.

you just help me which URL and which file i have to do the changes.
almost i have done all the things.

i think only this things is remained or mistaken by me.

Hi @Anil9860. You need to edit the “/etc/hosts” file so that the domain names “docker.mender.io” and “s3.docker.mender.io” resolve to the IP address of the system running your mender demo server. You cannot use localhost as that means the Mender client will try to connect to itself. Add the file into your build system in the rootfs_overlay_demo with the following contents, making sure to change 192.168.7.36 to the appropriate IP address for your system.

127.0.0.1	localhost
127.0.1.1	beaglebone.localdomain	beaglebone

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

192.168.7.36 docker.mender.io s3.docker.mender.io

Also, update the ServerURL in rootfs_overlay_demo/etc/mender/mender.conf to point to https://docker.mender.io.

You also need to download the demo server certificate from https://raw.githubusercontent.com/mendersoftware/meta-mender/master/meta-mender-demo/recipes-mender/mender/files/server.crt and store it in rootfs_overlay_demo/etc/mender/server.crt.

Finally make sure Mender uses that cert by adding it into rootfs_overlay_demo/etc/mender/mender.conf as follows:

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

hi Drew,

in the “etc/hosts” i have changed the
127.0.0.1 localhost
127.0.1.1 ubuntu-anil-pc

The following lines are desirable for IPv6 capable hosts

::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
192.168.1.95 s3.docker.mender.io # added by mender integration
192.168.1.95 docker.mender.io # added by mender integration

like wise i have done.
then copied the file from that location and pasted in the mender-converter folder which i downloaded by github. Am i right till here?

after that
in the home directory also mender there is a one folder with same name mender-converter there rootfs_overlay_demo/etc/mender/mender.conf in this file i have done the changes in the server URL.
{
“InventoryPollIntervalSeconds”: 5,
“RetryPollIntervalSeconds”: 30,
“ServerURL”: “https://docker.mender.io”,
“ServerCertificate”: “/etc/mender/server.crt”,
“TenantToken”: “Paste your Hosted Mender token here”,
“UpdatePollIntervalSeconds”: 5
}
see this
and after that i created a new file with the name of server.crt in the location of “/home/anil/mender-convert/rootfs_overlay_demo/etc” and copied the certificates into it which you have given.

and as you can see above i have done changes in the “/home/anil/mender-convert/rootfs_overlay_demo/etc/mender” mender.cnf file like above.

is anything wrong in it?

You also need to create /home/anil/mender-conver/rootfs_overlay_demo/etc/hosts containing the following:

127.0.0.1	localhost
127.0.1.1	beaglebone.localdomain	beaglebone

# The following lines are desirable for IPv6 capable hosts
::1     localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

192.168.7.36 docker.mender.io s3.docker.mender.io

Yes Drew,
According to our discussion i have done all changes and i tried everything, but still i am getting the same

debian@beaglebone:~$ sudo journalctl -u mender --follow
– Logs begin at Thu 2016-11-03 17:16:43 UTC. –
Aug 30 20:45:22 beaglebone mender[311]: level=info msg=“State transition: init [none] -> init [none]” module=mender
Aug 30 20:45:22 beaglebone mender[311]: time=“2018-08-30T20:45:22Z” level=info msg=“State transition: init [none] -> init [none]” module=mender
Aug 30 20:45:22 beaglebone mender[311]: level=info msg=“State transition: init [none] -> idle [Idle]” module=mender
Aug 30 20:45:22 beaglebone mender[311]: time=“2018-08-30T20:45:22Z” level=info msg=“State transition: init [none] -> idle [Idle]” module=mender
Aug 30 20:45:22 beaglebone mender[311]: time=“2018-08-30T20:45:22Z” level=info msg=“State transition: idle [Idle] -> authorize-wait [Idle]” module=mender
Aug 30 20:45:22 beaglebone mender[311]: level=info msg=“State transition: idle [Idle] -> authorize-wait [Idle]” module=mender
Aug 30 20:45:22 beaglebone mender[311]: level=info msg=“State transition: authorize-wait [Idle] -> authorize [Sync]” module=mender
Aug 30 20:45:22 beaglebone mender[311]: time=“2018-08-30T20:45:22Z” level=info msg=“State transition: authorize-wait [Idle] -> authorize [Sync]” module=mender
Aug 30 20:45:22 beaglebone mender[311]: time=“2018-08-30T20:45:22Z” level=info msg=“device keys not present or bootstrap forced, generating” module=mender
Aug 30 20:45:22 beaglebone mender[311]: level=info msg=“device keys not present or bootstrap forced, generating” module=mender
Oct 12 05:31:08 beaglebone mender[311]: level=error msg=“authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: Unauthorized” module=state
Oct 12 05:31:08 beaglebone mender[311]: time=“2019-10-12T05:31:08Z” level=error msg=“authorize failed: transient error: authorization request failed: (request_id: ): authentication request rejected server error message: Unauthorized” module=state
Oct 12 05:31:08 beaglebone mender[311]: level=info msg=“State transition: authorize [Sync] -> authorize-wait [Idle]” module=mender
Oct 12 05:31:08 beaglebone mender[311]: time=“2019-10-12T05:31:08Z” level=info msg=“State transition: authorize [Sync] -> authorize-wait [Idle]” module=mender

Authorization error.
I have doubt on the command of

./scripts/bootstrap-rootfs-overlay-demo.sh --output-dir ~/mender-convert/output

i am not getting the meaning of this command and why i have to run this.
after running this command i have done changes in the “/home/anil/mender-convert/rootfs_overlay_demo/etc/mender” mender.cnf file with server URL changes and other changes you suggested for crt file.

what is the error i am not getting?