HomeAssistantAddons icon indicating copy to clipboard operation
HomeAssistantAddons copied to clipboard

appkey is incorrect, can't start addon

Open DavidChrstn opened this issue 2 years ago • 44 comments

Hey together,

i noticed the addon crashing since this morning. The log shows an thrown 'er_invalid_appkey' error:

Error: appkey is incorrect 'er_invalid_appkey'

Is there a way to get an own api key instead of the default one?

DavidChrstn avatar Nov 30 '23 08:11 DavidChrstn

Hello,

Same issue here. I am using the default appkey. Host: https://gateway.isolarcloud.eu

giogua avatar Nov 30 '23 09:11 giogua

Hi Same issue here, also using default appkey

janneh-hub avatar Nov 30 '23 11:11 janneh-hub

Same here, issue appears to start last week

https://augateway.isolarcloud.eu/

[3.0.7] - 2023-09-04

Tried

init: false Init: true hassio_role: default host_pid: true

Techfluent-au avatar Nov 30 '23 17:11 Techfluent-au

Hello,

i have the same issue.

Thancks

InnoGreenTech avatar Nov 30 '23 20:11 InnoGreenTech

Just got the same error 😢

DouglasteR avatar Nov 30 '23 22:11 DouglasteR

Guess it is time to get that ethernet cable and move over to modbus.

anthony-spruyt avatar Dec 01 '23 21:12 anthony-spruyt

Guess it is time to get that ethernet cable and move over to modbus.

Nooooooo 😭

DouglasteR avatar Dec 02 '23 02:12 DouglasteR

Guess it is time to get that ethernet cable and move over to modbus.

Nooooooo 😭

Ive got a sparky coming on Friday to install a new smart meter and might as well ask him to lay some ethernet cabling to the inverter. Would end up being much less flaky and won't need maintenance/keeping in sync with dodgy 3rd party API such as iSolarCloud. This addon has been of great use to date, but sounds like they have finally started addressing the API vulnerabilities and in turn breaking this project.

anthony-spruyt avatar Dec 02 '23 03:12 anthony-spruyt

How do you even integrate the inverter with modbus?

giogua avatar Dec 02 '23 06:12 giogua

How do you even integrate the inverter with modbus?

https://github.com/MatterVN/ModbusTCP2MQTT

anthony-spruyt avatar Dec 02 '23 07:12 anthony-spruyt

How do you even integrate the inverter with modbus?

https://github.com/MatterVN/ModbusTCP2MQTT

Thanks, Will give It a try

giogua avatar Dec 02 '23 07:12 giogua

OML, so glad i found this thread, just spent 3hours trying to work remember how i installed this addon and got the APKEY all those months ago.

eXplague avatar Dec 03 '23 10:12 eXplague

Plus 1 Also I do have the same issue, unfortuantely. Hoping that someone will find a solution. Cheers and have a great 1st of Advent

dimafemabo avatar Dec 03 '23 14:12 dimafemabo

Just an educated guess, but my guess is that SunGrow has rotated the appkey that comes with the add-on.

mkhlm avatar Dec 04 '23 15:12 mkhlm

Any clue on how to try and get the new one?

giogua avatar Dec 04 '23 15:12 giogua

Waiting for any news as well. Really liked the Addon!

TrueMB avatar Dec 12 '23 20:12 TrueMB

still no news on this? same issue here

Keshin1988 avatar Dec 14 '23 10:12 Keshin1988

I have the issue too. Hoping for a solution! Fingers crossed...

mife1005 avatar Dec 14 '23 17:12 mife1005

hi,

i found a fix in the issues of the Go Sungrow projekt. The Community over ther fixed the whole thing.

https://github.com/MickMake/GoSungrow/issues/101#issuecomment-1845634809

Yoe need the "Advanced SSH & Web Terminal" Addon and run it without web protection. Connect via ssh (e.g. putty) and run the shell command to replace the docker image. Add the new passkey to the go sungrow config and restart.

worked for me

In the meantime, I've added my hack to the same gist in case the same approach is useful for anyone else.

Thank you @Paraphraser for that helpful gist! I have no experience with HomeAssistant, but I've managed to build, push and test docker images for the addon on all platforms, here is a simplified way to do a hack now:

1. connect to the HA instance over ssh

2. run:
old_image=`docker image list --format 'table {{.Repository}}:{{.Tag}}' | grep gosungrow | grep -vE 'triamazikamno|backup' | head -1`;
new_image=`echo $old_image | awk -F/ '{print"triamazikamno/"$2}'`;
docker tag $old_image ${old_image}-backup;
docker pull $new_image;
docker tag $new_image $old_image;
3. go to the HomeAssistant GUI, Settings, Add-ons, GoSungrow, Configuration tab and change sungrow_appkey to `B0455FBE7AA0328DB57B59AA729F05D8`

Restart GoSungrow when it prompts.

DavidChrstn avatar Dec 18 '23 07:12 DavidChrstn

Hi I tried the above approach but I get the following errors: First command goes through without error. Second command doesn't create any error Third one: docker tag $old_image ${old_image}-backup creates the following: unknown shorthand flag: 'b' in -backup See 'docker tag --help' What am I missing? Sorry I am noew to the docker and ssh usage. Many thanks Dietger

dimafemabo avatar Dec 21 '23 08:12 dimafemabo

It seems for like for me, that ${old_image} was not found. Do you have the Addon installed and is there a docker container installed?

Try this command: docker image list --format 'table {{.Repository}}:{{.Tag}}' | grep gosungrow | grep -vE 'triamazikamno|backup' | head -1

if it really goes through

TrueMB avatar Dec 21 '23 08:12 TrueMB

@dimafemabo

The error message you got means you had a space between the } and the -. So, instead of ${old_image}-backup being treated as a single argument, it was treated as two separate arguments ${old_image} and -backup, and then, because any argument to a Unix command starting with a dash is interpreted as an option to a command, the command went looking for -b and didn't find it.

What you need to do is to follow this exactly. Use copy/paste. Don't re-type anything.

Paraphraser avatar Dec 21 '23 12:12 Paraphraser

It seems for like for me, that ${old_image} was not found. Do you have the Addon installed and is there a docker container installed?

Try this command: docker image list --format 'table {{.Repository}}:{{.Tag}}' | grep gosungrow | grep -vE 'triamazikamno|backup' | head -1

if it really goes through

I guess this is the issue. The addon is installed on a HASSIO system and there is no docker showing. I ssh into me system with root@hassio-ip-address When I enter "docker ps" it says unknown command. Do I only get access to the home assistant system and not to the dockers?

Indeed installing portainer helps me to see the containers, also there I don't see a container which would be for Sungrow. In the image tab, I can see a list of images and one called "unused:unused" contains information which is related to sungrow.

Maybe someone can guide me to the point where I can enter the above details? Many thanks

dimafemabo avatar Dec 21 '23 13:12 dimafemabo

Just to make sure, are you using the "Advanced SSH & Web Terminal" Addon? There is a secure mode option. Try disabling this one and see if it helps.

TrueMB avatar Dec 21 '23 13:12 TrueMB

Advanced SSH & Web Terminal

Bad me! The advanced seems to be the key to everything. Just installing, I'll keep you posted. THX

dimafemabo avatar Dec 21 '23 14:12 dimafemabo

Unfortunately still the same. When I enter this command: docker tag $old_image ${old_image}-backup unknown shorthand flag: 'b' in -backup See 'docker tag --help'. In the command there is no "empty space" used bagnging my head here :-(

dimafemabo avatar Dec 21 '23 14:12 dimafemabo

My guess is, that this returns nothing: docker image list --format 'table {{.Repository}}:{{.Tag}}' | grep gosungrow | grep -vE 'triamazikamno|backup' | head -1

And since $old_image is nothing, following seems to be executed: docker tag -backup

Does this return anything: docker image list?

TrueMB avatar Dec 21 '23 14:12 TrueMB

The command: docker image list --format 'table {{.Repository}}:{{.Tag}}' | grep gosungrow | grep -vE 'triamazikamno|backup' | head -1

returns indeed nothing, just the prompt, should it return something?

The command docker image list returns a nice list of repositories:

REPOSITORY TAG IMAGE ID CREATED SIZE f8695bce14a1 2 hours ago 41.6MB ghcr.io/home-assistant/aarch64-hassio-supervisor 2023.12.0 e18c9dd86ab6 7 days ago 323MB ghcr.io/home-assistant/aarch64-hassio-supervisor latest e18c9dd86ab6 7 days ago 323MB ghcr.io/home-assistant/aarch64-base 3.16 d98f83db236d 9 days ago 41.6MB ghcr.io/alexbelgium/portainer-aarch64 2.19.4-3 8755ad924606 10 days ago 396MB ghcr.io/hassio-addons/ssh/aarch64 17.0.0 a305baf6b771 12 days ago 336MB d11097f030bd 2 weeks ago 521MB eeb054de/aarch64-addon-modbus_inverter 0.3.9 b662a5bf9baf 2 weeks ago 521MB ghcr.io/home-assistant/aarch64-hassio-cli 2023.11.0 7f39130b9251 4 weeks ago 129MB homeassistant/aarch64-addon-mosquitto 6.4.0 4cece12b2a0d 4 weeks ago 210MB homeassistant/aarch64-addon-ssh 9.8.1 b88a958e2f53 5 weeks ago 210MB ghcr.io/home-assistant/raspberrypi3-64-homeassistant 2023.11.1 4b9f6af13272 6 weeks ago 1.89GB 86f8e516bdcb 6 weeks ago 501MB ghcr.io/home-assistant/aarch64-hassio-audio 2023.10.0 0e25e5266546 7 weeks ago 162MB b0b94f8f6503 8 weeks ago 501MB ghcr.io/home-assistant/aarch64-base 81c12ba075a9 8 weeks ago 113MB ghcr.io/home-assistant/aarch64-base latest 40c0b5b95259 8 weeks ago 122MB bf9026bb6dc9 2 months ago 501MB 4a0b86523bfd 2 months ago 501MB ghcr.io/hassio-addons/vscode/aarch64 5.12.1 aee3da665843 2 months ago 952MB ghcr.io/home-assistant/aarch64-base 38221e77252e 2 months ago 122MB f6d48571890f 2 months ago 501MB ghcr.io/home-assistant/aarch64-base 5ef019e5ae9e 2 months ago 113MB ghcr.io/home-assistant/aarch64-base d3302f0a6b33 2 months ago 122MB ghcr.io/home-assistant/aarch64-hassio-dns 2023.06.2 9dd40b04adb7 5 months ago 140MB ghcr.io/home-assistant/aarch64-hassio-multicast 2023.06.2 b06077afe00c 5 months ago 125MB ghcr.io/home-assistant/aarch64-hassio-observer 2023.06.0 1b4771b44876 5 months ago 7.49MB homeassistant/aarch64-addon-samba 10.0.2 c64020e155b0 7 months ago 172MB

After looking into the image > none tag none and image ID f8695b.... I can see it contains a lot of environment variables with gosungrow.

dimafemabo avatar Dec 21 '23 15:12 dimafemabo

@dimafemabo I suppose that's why the gist I pointed you to had:

  • Step 1 emphasising ADVANCED SSH and Web Terminal ; and
  • Step 4 with echo commands plus examples of the kind of output you should expect to see.

If your question had been "the echo $old_image doesn't return anything" we might've got here much faster.

Here's what I see when I run either docker images or docker image list (they're really the same command) on my own system right now (after the steps in the gist):

IMG_2437

BEFORE I did the steps in the gist, my system looked like this:

IMG_2438

The output from your system is a little bit tricky to interpret because I'm not 100% sure of what I'm seeing (a screen shot would help) but it looks to me like:

  1. You might have old unused images that need to be cleaned up; and
  2. GoSungrow isn't actually installed on your system.

As an example of unused images, your output seems to contain six ghcr.io/home-assistant/aarch64-base images while mine only has a single ghcr.io/home-assistant/amd64-base image. In one sense, old unused images don't matter. All they do is occupy space on your disk. But, if HA should be cleaning up old images as it goes then the presence of old unused images might indicate that something else is wrong. I don't know enough about HA to say whether this is safe to ignore or not.

You could try cleaning up the old images by running:

# docker system prune -f

And then try installing the GoSungrow add-on. If you're about to tell me that GoSungrow is installed then I'd suggest:

  1. Stopping then Uninstalling it.
  2. Running the docker system prune -f command as above.
  3. Reinstallng GoSungrow.
  4. Doing the steps in the gist (link above).

If, after reinstalling, the echo commands in gist step 4 still don't return sensible values then:

  1. Run docker images.
  2. Take a screen shot and paste the screen shot in your reply.

If prune doesn't get rid of images that only have imageIDs (ie no names) then you can try brute force:

# docker rmi <imageID>

Just copy/paste each <imageID> in turn until they are all gone. Docker won't let you remove any images that are actually in use by a running container - but the fact that an unnamed <imageID> is still in use can also tell you something about what's running so perhaps capture that output too if it happens.

Paraphraser avatar Dec 21 '23 22:12 Paraphraser

THANKS ALOT!!! To start from scratch: Yes I used the **"advanced"**ssh tool. Sorry for not beeing able to produce that "echo $old_image" as I am a newbe on this one. However, let me thank you a thousand times!

  1. The GoSungrow addon was installed, at least according to the addon page, never mind,
    • I deinstalled GoSungrow
  2. for the command docker system prune -f really did the job and deleted a lot of unnamed images.
    • The image removal did its job,
  3. I installed GoSungrow and then followed the instruction to the letter,
  4. entered the new key,
  5. restarted GoSungrow and

I am happy to report all worked well and all the information is back in the system. Thanks for the patience and help received here! Amazing!

dimafemabo avatar Dec 22 '23 12:12 dimafemabo