Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Cannot update from 1.0.8 to 2.0.0 (Error 505) #47

Closed
Dominik-1980 opened this issue May 28, 2022 · 32 comments
Closed

[Bug]: Cannot update from 1.0.8 to 2.0.0 (Error 505) #47

Dominik-1980 opened this issue May 28, 2022 · 32 comments
Labels
bug Something isn't working

Comments

@Dominik-1980
Copy link

Dominik-1980 commented May 28, 2022

What happened?

I can´t update to 2.0.0 because of Error 505 and Permission Denied.... Please see the log below...

`npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { homebridge: '^1.3.5', node: '^14.18.1' },
npm WARN EBADENGINE current: { node: 'v16.15.0', npm: '8.5.5' }
npm WARN EBADENGINE }
npm ERR! code 1
npm ERR! path /homebridge/node_modules/homebridge-eufy-security/node_modules/ffmpeg-for-homebridge
npm ERR! command failed
npm ERR! command sh -c node install.js
npm ERR! Downloading ffmpeg from https://github.com/homebridge/ffmpeg-for-homebridge/releases/latest/download/ffmpeg-debian-armv7l.tar.gz
npm ERR! node:events:505
npm ERR! throw er; // Unhandled 'error' event
npm ERR! ^
npm ERR!
npm ERR! Error: EACCES: permission denied, open '/root/.npm/_ffmpeg_for_homebridge/.download'
npm ERR! Emitted 'error' event on WriteStream instance at:
npm ERR! at emitErrorNT (node:internal/streams/destroy:157:8)
npm ERR! at emitErrorCloseNT (node:internal/streams/destroy:122:3)
npm ERR! at processTicksAndRejections (node:internal/process/task_queues:83:21) {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: '/root/.npm/_ffmpeg_for_homebridge/.download'
npm ERR! }

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-05-28T16_03_29_008Z-debug-0.log
`

@Dominik-1980 Dominik-1980 added the bug Something isn't working label May 28, 2022
@github-actions
Copy link

Did you check this Common Issues pages ?

@thieren
Copy link
Contributor

thieren commented May 29, 2022

Hi @Dominik-1980

There seems that there was a server error with the ffmpeg-for-homebridge dependency yesterday. I too couldn't download the file referenced in your log. Now it works for me.

Can you try again?

@Dominik-1980
Copy link
Author

I gave it a try right now.
The error remains for me...

@thieren
Copy link
Contributor

thieren commented May 29, 2022

Could you please specify which homebridge version you're using? The log mentions that it's requiring version 1.3.5 and up. Actually for 2.0.0 you should even need a version > 1.4.1.

Maybe you'll have to update this package first.

@Dominik-1980
Copy link
Author

I am using 1.4.1 and homebridge docker on a raspberry pi 4

@thieren
Copy link
Contributor

thieren commented May 30, 2022

Did you already try to completely uninstall the plugin and then do a fresh install with 2.0.0?

@Dominik-1980
Copy link
Author

No, I didn't, because I don't want to loose all of my automations...

I tried to install 2.0.1-beta3. It works.

It is just the 2.0.0 Version which doesn't works.

So I will stay on 2.0.1-beta3 until the next stable version...

@TimMichael69
Copy link

can not install the beta....

USER: root
DIR: /homebridge
CMD: npm install --save [email protected]

npm ERR! code 1
npm ERR! path /homebridge/node_modules/homebridge-eufy-security/node_modules/ffmpeg-for-homebridge
npm ERR! command failed
npm ERR! command sh -c node install.js
npm ERR! Downloading ffmpeg from https://github.com/homebridge/ffmpeg-for-homebridge/releases/download/v0.1.0/ffmpeg-alpine-x86_64.tar.gz
npm ERR! node:events:368
npm ERR! throw er; // Unhandled 'error' event
npm ERR! ^
npm ERR!
npm ERR! Error: EACCES: permission denied, open '/root/.npm/_ffmpeg_for_homebridge/.download'
npm ERR! Emitted 'error' event on WriteStream instance at:
npm ERR! at emitErrorNT (node:internal/streams/destroy:157:8)
npm ERR! at emitErrorCloseNT (node:internal/streams/destroy:122:3)
npm ERR! at processTicksAndRejections (node:internal/process/task_queues:83:21) {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: '/root/.npm/_ffmpeg_for_homebridge/.download'
npm ERR! }

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2022-06-01T09_12_26_486Z-debug.log

Operation failed. Please review log for details.

@thieren
Copy link
Contributor

thieren commented Jun 1, 2022

Hi @TimMichael69

sry I can't reproduce this. For me it installs without any issues.
According to your logs you have something going on with your permissions (despite being root).

But since this can't be reproduced I don't think we can help you here really.

Did you follow any tutorial for homebridge installation?
I for example only know the global install option for plugins (npm install -g homebridge-eufy-security@beta). But your method also works for me.

@TimMichael69

This comment was marked as off-topic.

@thieren
Copy link
Contributor

thieren commented Jun 1, 2022

It seems the plugin is unable to start the ffmpeg process on your system.

Did you try to install ffmpeg-for-homebridge globally as pointed out under https://github.com/homebridge-eufy-security/plugin/wiki/Common-Issues section Livestream?

Since this has nothing to do with the original issue I'll delete your posts and we can discuss this further in your other issue #60

@thieren thieren mentioned this issue Jun 1, 2022
@thieren
Copy link
Contributor

thieren commented Jun 7, 2022

Hey @Dominik-1980

Since this issue is not relevant for you anymore I'll close this. Please reopen if there are new things to share.

For anyone having update problems: There is a new section in Common issues which might help: https://github.com/homebridge-eufy-security/plugin/wiki/Common-Issues

@thieren thieren closed this as completed Jun 7, 2022
@permaMonk
Copy link

permaMonk commented Jun 21, 2022

Is this the same error?

I have had the same behavior updating to version 2.0.0. After a long painful process with de-installations, restarts, deleting directories, etc. I´ve got the system running again. Now it all comes up again when I try to install version 2.0.1.

--
USER: homebridge
DIR: /usr/local
CMD: sudo -E -n npm install -g homebridge-eufy-security@latest

npm WARN config global --global, --local are deprecated. Use --location=global instead.
npm ERR! code 1
npm ERR! path /usr/local/lib/node_modules/homebridge-eufy-security/node_modules/ffmpeg-for-homebridge
npm ERR! command failed
npm ERR! command sh -c node install.js
npm ERR! Downloading ffmpeg from https://github.com/homebridge/ffmpeg-for-homebridge/releases/latest/download/ffmpeg-raspbian-armv6l.tar.gz
npm ERR! node:events:505
npm ERR! throw er; // Unhandled 'error' event
npm ERR! ^
npm ERR!
npm ERR! Error: EACCES: permission denied, open '/home/homebridge/.npm/_ffmpeg_for_homebridge/.download'
npm ERR! Emitted 'error' event on WriteStream instance at:
npm ERR! at emitErrorNT (node:internal/streams/destroy:157:8)
npm ERR! at emitErrorCloseNT (node:internal/streams/destroy:122:3)
npm ERR! at processTicksAndRejections (node:internal/process/task_queues:83:21) {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'open',
npm ERR! path: '/home/homebridge/.npm/_ffmpeg_for_homebridge/.download'
npm ERR! }

npm ERR! A complete log of this run can be found in:
npm ERR! /home/homebridge/.npm/_logs/2022-06-21T15_47_18_367Z-debug-0.log

Operation failed. Please review log for details.

Sorry if I don't see what to do.

@thieren
Copy link
Contributor

thieren commented Jun 21, 2022

HI @permaMonk

can you attach the mentioned log /home/homebridge/.npm/_logs/2022-06-21T15_47_18_367Z-debug-0.log?

Better still: contact me on discord if you can.

@permaMonk
Copy link

Don´t know how to contact you directly in Discord. Don´t know how to copy (the contend of) this logfile.

@thieren
Copy link
Contributor

thieren commented Jun 22, 2022

just drag the file onto the textbox where you're typing your comment here. It will attach the file.

@permaMonk
Copy link

permaMonk commented Jun 22, 2022

Drag&Drop not possible. I’m working only with CLI on that RasPi. Can open the log file with nano but unable to mark the whole content, then copy it to paste it in a text file on my PC.

Yes I know much to learn about Unix.

@thieren
Copy link
Contributor

thieren commented Jun 22, 2022

well you log into it using ssh or something, right? Just copy the file via ssh: https://www.simplified.guide/ssh/copy-file

@permaMonk
Copy link

Yes via ssh.

Your link sounds as a big help. I’ll try this later.

@permaMonk
Copy link

Ok it was a long way. Here it comes - the log file
Logfile.txt
.

@thieren
Copy link
Contributor

thieren commented Jun 22, 2022

Unfortunately it doesn't say exactly what's wrong, or I'm not seeing the issue right away.

Anyway the bug seems to be about the FFmpeg-for-homebridge dependency as was already stated by the error message above.

You could try a few things (I would suggest from top to bottom to do one step at a time and see if the update then works)

all commands will have to be run as root

  1. try to install the dependency manually: node /usr/local/lib/node_modules/homebridge-eufy-security/node_modules/ffmpeg-for-homebridge/install.js
  2. try to install the dependency globally: npm install -g ffmpeg-for-homebridge
  3. remove both installed directories (e.g. npm uninstall -g ffmpeg-for-homebridge and rm -rf node /usr/local/lib/node_modules/homebridge-eufy-security/node_modules/ffmpeg-for-homebridge/ and rm -rf node /usr/local/lib/node_modules/ffmpeg-for-homebridge/ (the last one should do nothing if it was uninstalled correctly previously)

Try updating after each step and see if it has helped.

Let me know ;-)

@permaMonk
Copy link

I`ll give this a try on the weekend.

@permaMonk
Copy link

permaMonk commented Jun 26, 2022

Ok, done. But nothing helped. :(
Protocol.txt

So I´ve deinstalled the plugin and re installed. But same error as before. Now it´s gone - totally.

@thieren
Copy link
Contributor

thieren commented Jun 27, 2022

I have to admit that I'm longshotting here, but what happens if you'll drop the -E option from your sudo command?

Does any part of the path mentioned in the error messages even exist? /home/homebridge/.npm/_ffmpeg_for_homebridge/.download

@permaMonk
Copy link

You mean the original automated Homebridge-Eufy-security Plugin command “sudo -E -n npm install -g homebridge-eufy-security@latest”? Doing this manually on CLI without -E?

btw: What is the function of -E?

@thieren
Copy link
Contributor

thieren commented Jun 27, 2022

Yep. You can just run that manually on cli and it will do exactly what homebridge tries to do for you.

-E preserves the environment variables for this command. So homebridge tries to install something as root (hence the sudo) but want's it to use the $PATH, $HOME, etc. variables for it.
My thinking is, that maybe something is wrong with these variables and by removing -E it will fallback to the root's user variables... But as said: without knowing the exact cause it's kind of a longshot.

For me at least a normal sudo npm install -g homebridge-eufy-security works just fine.

@thieren
Copy link
Contributor

thieren commented Jun 27, 2022

Btw. you should drop -n also I think. This prevents sudo from asking for a password. If you do this manually then it might error out due to the lack of the password.

@permaMonk
Copy link

So could say this worked.
sudo npm install -g homebridge-eufy-security@latest
added 145 packages, and audited 146 packages in 35s
23 packages are looking for funding
run npm fund for details
found 0 vulnerabilities

After restart Homebridge needed really long time to come up. A little fine tuning like unbridge the plugin. Replace username / MAC address and port number with the old data was necessary cause with the new data the Eufy Cam Status was not reachable / grey.

So happy again - but I'm afraid I'll have to do every future update manually.

Now a little bit later get red errors:
ERROR: write EPIPE
err: Error: write EPIPE
at afterWriteDispatched (node:internal./stream_base_commons:160:15)
at writeGeneric (node:internal./stream_base_commons:151:3)
at Socket._writeGeneric (node:net:817:11)
at Socket._write (node:net:829:8)
at writeOrBuffer (node:internal./streams/writable:389:12)
at _write (node:internal./streams/writable:330:10)
at Socket.Writable.write (node:internal./streams/writable:334:10)
at VideostreamProxy.ondata (node:internal./streams/readable:754:22)
at VideostreamProxy.emit (node:events:527:28)
at addChunk (node:internal./streams/readable:315:12)
INFO: ErrorCode EPIPE

Sorry for the trouble.

@TimMichael69
Copy link

So could say this worked. sudo npm install -g homebridge-eufy-security@latest added 145 packages, and audited 146 packages in 35s 23 packages are looking for funding run npm fund for details found 0 vulnerabilities

After restart Homebridge needed really long time to come up. A little fine tuning like unbridge the plugin. Replace username / MAC address and port number with the old data was necessary cause with the new data the Eufy Cam Status was not reachable / grey.

So happy again - but I'm afraid I'll have to do every future update manually.

Now a little bit later get red errors: ERROR: write EPIPE err: Error: write EPIPE at afterWriteDispatched (node:internal./stream_base_commons:160:15) at writeGeneric (node:internal./stream_base_commons:151:3) at Socket._writeGeneric (node:net:817:11) at Socket._write (node:net:829:8) at writeOrBuffer (node:internal./streams/writable:389:12) at _write (node:internal./streams/writable:330:10) at Socket.Writable.write (node:internal./streams/writable:334:10) at VideostreamProxy.ondata (node:internal./streams/readable:754:22) at VideostreamProxy.emit (node:events:527:28) at addChunk (node:internal./streams/readable:315:12) INFO: ErrorCode EPIPE

Sorry for the trouble.

Which Port did you use? how do I found which port my Doorbell is Using?

@permaMonk
Copy link

The plugin finds the entries username / MAC address and port number by itself and sets them in its config. I have only overwritten the new values with the entries from the backup of the old config.

@thieren
Copy link
Contributor

thieren commented Jun 28, 2022

So happy again - but I'm afraid I'll have to do every future update manually.

Now a little bit later get red errors:

Glad this helped.

The error you're experiencing is most likely this one: #14

Am I right to suspect that this only is a log output and doesn't crash the plugin/homebridge?
As mentioned in the linked issue this is known but doesn't seem to introduce any unwanted behaviour. Also this seems to happen very randomly.

@permaMonk
Copy link

You are right - it’s a snippet of the log, no more crashing of the plug-in.

I take a look to the #14 thread later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

4 participants