Error on "sam init"

raspberry

#1

Hi all,

I tried to install snips on a raspi3+, this is the second one. The first one, I installed on Nov last year is runnig fine. But now I get an error after sam init.
pi@snips2:~ $ sam init
Installing Snips Platform components. This may take a few minutes…
:heavy_check_mark: Updating aptitude repository
:heavy_check_mark: Installing dirmngr
:heavy_check_mark: Adding Snips APT source list
Adding Snips PGP public key
:heavy_multiplication_x: Failed to install platform: Error: ENOENT: no such file or directory, open ‘/usr/lib/node_modules/snips-sam/lib/assets/snips-pgp-key.asc’
at Object.fs.openSync (fs.js:653:18)
at Object.fs.readFileSync (fs.js:554:33)
at Function.readFile (/usr/lib/node_modules/snips-sam/lib/assets/assets.js:25:24)
at Function.pgpKey (/usr/lib/node_modules/snips-sam/lib/assets/assets.js:19:21)
at sshCommandLog.then.then.then._ (/usr/lib/node_modules/snips-sam/lib/session/ssh.js:457:64)
at
at process._tickCallback (internal/process/next_tick.js:188:7)

Now I tried it manually, but without success.
pi@snips2:~ $ sudo apt-key adv --keyserver pgp.mit.edu --recv-keys D4F50CDCA10A2849
Executing: /tmp/apt-key-gpghome.75EX72Ba5f/gpg.1.sh --keyserver pgp.mit.edu --recv-keys D4F50CDCA10A2849
gpg: keyserver receive failed: No data

I think that is the problem, isn’t it’?

Thanks a lot for your help.


[SOLVED] Sam init fails when trying to add sam pgp public key
Sam initしてもSnips Platform not installedのままになる(Checking with sam status will keep Snips Platform not installed.)
#2

I am also facing the same problem which I have posted like 10 mins back. I am using windows machine as a third-party device to install snips.


#3

That makes three of us. A solution to this would make me very happy.


#4

Okay, i made it work. :slight_smile:

Follow Step 2 of https://docs.snips.ai/articles/raspberrypi/manual-setup but with the replacement of pgp.mit.edu

So the following are your commands on your Pi terminal:

sudo apt-get update

sudo apt-get install -y dirmngr

sudo bash -c ‘echo “deb https://raspbian.snips.ai/$(lsb_release -cs) stable main” > /etc/apt/sources.list.d/snips.list’

sudo apt-key adv --keyserver pgp.surfnet.nl --recv-keys D4F50CDCA10A2849

sudo apt-get update

sudo apt-get install -y snips-platform-voice

After that ‘sam status’ should recognize snips as installed on the device and you can return to the sam guide and use it to configure your audio, assistants etc.


#5

It does’nt work for me :disappointed_relieved:


#6

Check your NodeJS and npm version using node -v and npm -v. npm version required 6.7
You need to upgrade both personal computer and RPi nodeJS version

For Ubuntu
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
sudo apt install nodejs

For RPi
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
. ~/.bashrc
nvm install 8.6

image


#7

Hi ruchir,

thanks for your answer.
my versions are right I think
pi@snips2:~ node -v v11.10.0 pi@snips2:~ npm -v
6.7.0
Maybe nodejs is a level to high, but I had a try with version 10 with the same result.
Any other idea?

thanks a lot


#8

I had the same issue. The workaround provided by hein0r worked for me. npm v1.4.21 nodejs v8.11.1

What error did you see when executing this command:

sudo apt-key adv --keyserver pgp.surfnet.nl --recv-keys D4F50CDCA10A2849?


#9

Can confirm, even after running

apt install snips-asr snips-nlu snips-platform-common snips-platform-voice snips-tts snips-watch

I still get

root@raspberrypi-snips:/home/pi# sam init
Installing Snips Platform components. This may take a few minutes... 
� Updating aptitude repository
� Installing dirmngr
� Adding Snips APT source list
  Adding Snips PGP public key
� Failed to install platform: Error: ENOENT: no such file or directory, open '/usr/local/lib/node_modules/snips-sam/lib/assets/snips-pgp-key.asc'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.readFileSync (fs.js:551:33)
    at Function.readFile (/usr/local/lib/node_modules/snips-sam/lib/assets/assets.js:25:24)
    at Function.pgpKey (/usr/local/lib/node_modules/snips-sam/lib/assets/assets.js:19:21)
    at sshCommandLog.then.then.then._ (/usr/local/lib/node_modules/snips-sam/lib/session/ssh.js:457:64)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

#10

Note:- Do not do this in root
As I suggest tlrider to update NodeJS version
and then use
sudo npm i -g npm
sudo apt-get update
sudo apt-get upgrade
and then try sudo sam init

He is able to fix that


#11

Hello.
Copying snips-pgp-key.asc from npm \ node_modules \ snips-sam \ src \ assets will complete but the status will remain not installed.
Use google translate


Sam initしてもSnips Platform not installedのままになる(Checking with sam status will keep Snips Platform not installed.)
#12

Hello,

This was a bug in Sam and it was fixed in version 0.0.51.
You can update sam with
npm install -g snips-sam


Sam initしてもSnips Platform not installedのままになる(Checking with sam status will keep Snips Platform not installed.)
closed #13