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

Plugin keeps forgetting my key #19

Closed
BenWoodford opened this issue Jan 12, 2018 · 77 comments

Comments

@BenWoodford
Copy link

commented Jan 12, 2018

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?

@CoDanny CoDanny added the bug label Jan 12, 2018

@CoDanny CoDanny added this to the 1.0.2 milestone Jan 12, 2018

@CoDanny

This comment has been minimized.

Copy link
Member

commented Jan 12, 2018

It's likely that the access token is being deleted. How often does this happen? Can you give more details?

Do you log out of your OctoPi? Does it just happen by itself?

@BenWoodford

This comment has been minimized.

Copy link
Author

commented Jan 12, 2018

I'd probably say it's most common overnight. My Octoprint server is online 24/7, and isn't in a docker container or anything so it's not like it's got a config to lose.

Saying there, the config.yaml does not have my API key saved in it. Could it be that?

@GitSoks

This comment has been minimized.

Copy link

commented Jan 14, 2018

I have the same problem my key is reseting every time I disconnect the raspberry from power (i don't know if this also happens if I shut it down normally)

@CoDanny CoDanny closed this in bc70ca0 Jan 17, 2018

@foo25amc

This comment has been minimized.

Copy link

commented Feb 26, 2018

This also happens to me every time I shutdown or reboot. It's a shame, because the notification and email is really useful!

@Alfonsopl

This comment has been minimized.

Copy link
Collaborator

commented Feb 26, 2018

Could you provide more information about your environment and octopi, and plugin version?

@foo25amc

This comment has been minimized.

Copy link

commented Feb 26, 2018

I'm using a RPi3 running OctoPrint v1.3.6, OctoPi v0.14.0, and Astroprint v1.0.2. All packages are also up to date.

@Joe-houghton

This comment has been minimized.

Copy link

commented Sep 2, 2018

Hi,

I know this issue is closed, but it is happening to me also. It seems to be when I do not select "Shutdown" and instead just pull the power.

Joe

@Alfonsopl

This comment has been minimized.

Copy link
Collaborator

commented Sep 3, 2018

I can not reproduce the error.
Could you provide more information about your environment and octopi, and plugin version?
Also are you logged to your octopi account after you reboot/shutdown?

@Joe-houghton

This comment has been minimized.

Copy link

commented Sep 5, 2018

Hi,
Sorry about the delay.
I am using Octopi 1.3.9 (although it was happening in 1.3.8 too)
I installed AstroPrint plugin via the plugin manager and it says version AstroPrint (1.1.0).
Yes I am logged into Octopi after a shutdown, using Raspberry Pi 3.

Is there any more information that I can give you?

Joe

@raffaelps

This comment has been minimized.

Copy link

commented Sep 14, 2018

I had the same error, every time when my Octopi shutdown, when I turn on the Octopi the plugin lost the key.

  • Octopi Version 1.3.9
  • AstroPrint Version 1.1.0

Thanks

@Alfonsopl

This comment has been minimized.

Copy link
Collaborator

commented Sep 14, 2018

I have try with different versions of plugin and octopi and I am still not able to reproduce this error.

I think that the error could be that the plugin is not saving data into its database, that is why it can not find your access token.

Could you check if there is any encrypted data (or even file created) on /.octoprint/data/astroprint/octoprint_astroprint.db ?

@raffaelps

This comment has been minimized.

Copy link

commented Sep 19, 2018

No @Alfonsopl, there isn't any encrypted data.

@jmichelsen

This comment has been minimized.

Copy link

commented Sep 19, 2018

I experience this issue too. I thought I had a corrupted SD card so I actually just rebuilt my octopi setup on a new card with the current version of octopi and astroprint. If the pi gets rebooted, regardless of the method (shutdown, restart, loss of power), I have to re-enter my API key.

@CoDanny

This comment has been minimized.

Copy link
Member

commented Sep 19, 2018

@raffaelps if this file /.octoprint/data/astroprint/octoprint_astroprint.db doesn't exists, that is the problem. Now we need to find out why it can't be created. Are you able to access the plugin logs and send them to us?

@CoDanny CoDanny reopened this Sep 19, 2018

@FedorSosnin

This comment has been minimized.

Copy link

commented Sep 25, 2018

Sadly, having the same issue.

@daijoubu

This comment has been minimized.

Copy link

commented Sep 26, 2018

@Selfsustained

This comment has been minimized.

Copy link

commented Oct 9, 2018

@CoDanny I am not finding any astroprint directories after install. Using both putty and WinSCP over ssh to rpi3. Octoprint version: 1.3.9 Octopi version: 0.15.1 Astroprint version: 1.1.0

Edit: Immediately upon inputting my key and clicking link account button, page refreshes to astroprint asking for my permission. Upon authorizing and page refreshes back to octoprint there is an error that states that boxrouter could not connect. I am adding a small snip picture of what shows up.
capture

@moalemadi

This comment has been minimized.

Copy link

commented Oct 29, 2018

Did any one find the solution to this problem? I have fully setup the printer to run remotely including powering on/off, cam and Octopi. Now it is useless since I have to be connected to the local network to enter the key every time.

@ckohljr

This comment has been minimized.

Copy link

commented Jan 15, 2019

Bump - I also have this issue when I power cycle my OctoPI. I have recently installed OctoPrint image and AstroPrint plugin within the last 2 weeks and it loses my key every time I reboot. Any Help?

@Alfonsopl

This comment has been minimized.

Copy link
Collaborator

commented Jan 15, 2019

Bump - I also have this issue when I power cycle my OctoPI. I have recently installed OctoPrint image and AstroPrint plugin within the last 2 weeks and it loses my key every time I reboot. Any Help?

Could you report what permissions has /.octoprint/data/astroprint/octoprint_astroprint.db ? Looks like the data is not being stored on database, and that is why the plugin "loses" the key on reboot. Some of the users has already reported that this file is empty.

@ckohljr

This comment has been minimized.

Copy link

commented Jan 16, 2019

Thanks for the quick response, here are the permissions on the db:

pi@ender3octopi:/.octoprint/data/astroprint $ ls -l
total 16
-rw-r--r-- 1 pi pi 16384 Jan 16 05:00 octoprint_astroprint.db
pi@ender3octopi:
/.octoprint/data/astroprint $

I don't know why GitHub is using strikeout on the command but it is:
-rw-r--r--

@flyingelephant19

This comment has been minimized.

Copy link

commented Feb 21, 2019

i get the same issue. well everytime i shutdown the PI and restart, the creditials are gone and have to re enter and on one of my PI's i am running the latest 0.16 octopi.

@markarsenich

This comment has been minimized.

Copy link

commented Feb 23, 2019

I'm also having the same issue and I have NO IDEA how to fix it... every time I reboot I loose the access key. Upon print completion my Octroprint sends a shutdown request via IFTTT to my wifi plug and it turns everything off thats plugged into my surge bar. when i turn everything back on theres no key, i have to log into astroprint.com, get the key, copy it over. has essentially made Astroprint (which i love) useless to me. PLEASE HELP!

@CoDanny

This comment has been minimized.

Copy link
Member

commented Feb 23, 2019

@markarsenich Does the same happen if you don't turn everything off that way and instead simply reboot the box via the octoprint options?

@rchoughton

This comment has been minimized.

Copy link

commented May 15, 2019

Has anyone figured out how to solve this problem?

@CoDanny

This comment has been minimized.

Copy link
Member

commented May 15, 2019

@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

This comment has been minimized.

Copy link

commented May 16, 2019

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

@CoDanny

This comment has been minimized.

Copy link
Member

commented May 17, 2019

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

This comment has been minimized.

Copy link

commented May 18, 2019

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

@Steveps3

This comment has been minimized.

Copy link

commented May 18, 2019

These are the permissions that I have
image

@CoDanny

This comment has been minimized.

Copy link
Member

commented May 18, 2019

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

@Steveps3

This comment has been minimized.

Copy link

commented May 18, 2019

The file permissions are
image

Yes, everything is running under the pi user.

@CoDanny

This comment has been minimized.

Copy link
Member

commented May 18, 2019

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

This comment has been minimized.

Copy link

commented May 18, 2019

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

@sloth711

This comment has been minimized.

Copy link

commented May 18, 2019

Hello... The problem it's solve?

@Steveps3

This comment has been minimized.

Copy link

commented May 18, 2019

It is a bit optimistic to say that.

@Steveps3

This comment has been minimized.

Copy link

commented May 24, 2019

Failed again.

@CoDanny CoDanny removed this from the 1.0.2 milestone May 24, 2019

@rchoughton

This comment has been minimized.

Copy link

commented May 24, 2019

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

@CoDanny

This comment has been minimized.

Copy link
Member

commented Jul 23, 2019

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:

boxIdFile = "%s/box-id" % os.path.dirname(self._settings._configfile)

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

This comment has been minimized.

Copy link

commented Jul 23, 2019

@seltix5

This comment has been minimized.

Copy link

commented Jul 26, 2019

I have the same problem =/

@CoDanny

This comment has been minimized.

Copy link
Member

commented Jul 26, 2019

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

@seltix5

This comment has been minimized.

Copy link

commented Jul 26, 2019

No, clean install and installed plugin

@CoDanny

This comment has been minimized.

Copy link
Member

commented Aug 2, 2019

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

This comment has been minimized.

Copy link

commented Aug 3, 2019

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

@Steveps3

This comment has been minimized.

Copy link

commented Aug 3, 2019

Welcome to the club.

@Steveps3

This comment has been minimized.

Copy link

commented Aug 7, 2019

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

This comment has been minimized.

Copy link
Member

commented Aug 7, 2019

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

This comment has been minimized.

Copy link

commented Aug 9, 2019

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

@seltix5

This comment has been minimized.

Copy link

commented Aug 10, 2019

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

This comment has been minimized.

Copy link
Member

commented Aug 11, 2019

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.

@CoDanny CoDanny closed this Aug 11, 2019

@AstroPrint AstroPrint locked as resolved and limited conversation to collaborators Aug 11, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
You can’t perform that action at this time.