AstroPrint / OctoPrint-AstroPrint

Connect your OctoPrint device to the AstroPrint 3D Printing Cloud
31 stars 10 forks source link

Plugin keeps forgetting my key #19

Closed BenWoodford closed 5 years ago

BenWoodford commented 6 years ago

Or something like that. I regularly find that Astroprint no longer knows about my printer, and I have to re-enter my Astroprint key.

Any ideas?

rchoughton commented 5 years ago

Has anyone figured out how to solve this problem?

CoDanny commented 5 years ago

@rchoughton Our best guess right now is that in some installations filesystem permissions are preventing our files from being written and there not able to persist the key values.

rchoughton commented 5 years ago

Are these permissions that I can go in and change? Will they will stick making the system remember the key?

CoDanny commented 5 years ago

You can change the permissions of the directory: /home/pi/.octoprint/data/astroprint

@Steveps3, the path I gave you before was wrong. Can you check this new one?

Steveps3 commented 5 years ago

I have two files in that directory print_files.yaml user.yaml

Steveps3 commented 5 years ago

These are the permissions that I have image

CoDanny commented 5 years ago

Thanks @Steveps3, What about the permissions of the files themselves? Also does the octoprint daemon run under the 'pi' user?

Steveps3 commented 5 years ago

The file permissions are image

Yes, everything is running under the pi user.

CoDanny commented 5 years ago

can you give write permissions to all and reboot just to test if that helps with your problem. You might have to enter the key one time after reboot and then it should stick

Steveps3 commented 5 years ago

Done. I will have to see how it gets on.

sloth711 commented 5 years ago

Hello... The problem it's solve?

Steveps3 commented 5 years ago

It is a bit optimistic to say that.

Steveps3 commented 5 years ago

Failed again.

rchoughton commented 5 years ago

Same for me. It seemed to work for a few days and then it started loosing the key yesterday again.

CoDanny commented 5 years ago

We have a new clue about this problem. Some people that see this happen in their installation had cloned their sd card from another working octopi. This creates a problem by which two boxes are registering in the AstroPrint network with the same box id, which makes one of them invalid and could be causing this.

If this was the case, could you simply remove the box-id file referenced here. It should be in the same directory as your config.yaml: https://github.com/AstroPrint/OctoPrint-AstroPrint/blob/1c9b385daaaf57767a927015aacf21b0e3b8daff/octoprint_astroprint/boxrouter/__init__.py#L187

then restart. This might fix the issue.

Let us know by giving this comment a thumbs up if it does or a thumbs down if it doesn't

Reference: https://forum.astroprint.com/t/can-t-set-up-the-astroprint-plugin-on-my-second-octopi/4635/3

Steveps3 commented 5 years ago

Hi Daniel, My SD was not cloned but I will certainly give that a try.  ThanksSteve

Sent from Yahoo Mail for iPhone

seltix5 commented 5 years ago

I have the same problem =/

CoDanny commented 5 years ago

@seltix5 Did you create your octopi by cloning another box?

seltix5 commented 5 years ago

No, clean install and installed plugin

CoDanny commented 5 years ago

New Release 1.3(2) with another attempt to fix this. Let me know if anybody in this thread can see improvements regarding the problem being discussed.

cable1996 commented 5 years ago

Yeah, I updated with the release, and now I'm having the issue when it didn't happen before.

Steveps3 commented 5 years ago

Welcome to the club.

Steveps3 commented 5 years ago

I assume the new method is to have the connection to AstroPrint reconnect every 5 seconds? On my iPad I am constantly being spammed by AstroPrint connection toast when I view the octoprint interface. So now I have to disconnect from AstroPrint just so that I can use octoprint.

CoDanny commented 5 years ago

Absolutely not @Steveps3, your box certainly has a problem connecting and keep the connection. We do try to reconnect when the connection is lost but it shouldn't be every 5 secs. This is likely the root problem. Please open a ticket with us to see what might be going.

rchoughton commented 5 years ago

I have been using for a few days and this morning the key was lost and I have to redo it.

seltix5 commented 5 years ago

I can confirm too, the problem is still there. Today I try to use it and the key was lost. I can't say when it append but it was after last update.

CoDanny commented 5 years ago

The key can be lost for many other reasons including expiration of credentials after not using it for a long time. This problem was about they key being forgotten repeatedly in a short amount of time. After consulting with a few affected users, this particular problem (there might be others) seems to have been solved. Two things were causing it:

1) A bug in our software by which a rejection of connection by our servers would log the user out. This sometimes meant that poor connectivity or misconfigured boxes (see second reason below) could wrongly log you our and ask you to log in again.

2) Users using an OctoPi devices which was made off a clone of another one were the plugin was active created a situation where two boxes were being logged into our system as one. When a box logs into our system with the same Box Id as another, the previous one is kicked out, this caused reason number 1 above happened.

This issues has now grown quite large and is confusing people that for other reasons loose their credentials on occasion to add comments here. I'm going to close and lock this issue now.

If you experience loss of credentials again, please reopen another ticket and explain how often this happens, look to see if you have more than one OctoPi connected to your account and whether the second one was a clone of the first and provide this info in the ticket.