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?

CoDanny commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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)

foo25amc commented 6 years ago

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

Alfonsopl commented 6 years ago

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

foo25amc commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

Thanks

Alfonsopl commented 6 years ago

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 commented 6 years ago

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

jmichelsen commented 6 years ago

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 commented 6 years ago

@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?

FedorSosnin commented 6 years ago

Sadly, having the same issue.

daijoubu commented 6 years ago

Myself as well. I did find the settings file specified on my raspberry pi, but can't confirm if the key was correctly stored or not.

On Tue, Sep 25, 2018 at 1:48 PM FedorSosnin notifications@github.com wrote:

Sadly, having the same issue.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/AstroPrint/OctoPrint-AstroPrint/issues/19#issuecomment-424496353, or mute the thread https://github.com/notifications/unsubscribe-auth/AAaDMYy3kvCiSEd56PgaoBrOORAVMuZbks5uepa1gaJpZM4Rci8h .

Selfsustained commented 6 years ago

@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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

markarsenich commented 5 years ago

FIXED! All I did was uninstall reboot, re-install reboot, now it works, cut power multiple times, stays logged in.

flyingelephant19 commented 5 years ago

mark, i cant say the same for me :(

flyingelephant19 commented 5 years ago

are there any logs that can be given ?

markarsenich commented 5 years ago

well spoke too soon, not fixed, logging out on power off/on again... about to uninstall this plugin

CoDanny commented 5 years ago

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

Also are there any other plugins you installed between the time it was working and when it stopped working? Our current assumption is that another plugin is causing this behavior when installed together with ours. We just don't know which just yet.

drzejkopf commented 5 years ago

I experience very same problem with plugin, and it's really irritating. If it's really related to other plugins then maybe it's good idea for everyone experiencing it to post which (non-bundled) plugins they have installed, then it will be easier to tell which plugin/plugins may possibly cause problems, I will start: -Action Commands (0.1) -AstroPrint (1.2.0) -DeleteAfterPrint Plugin (1.2.0) -Exclude Region (0.1.3) -Fan Speed Control (0.2.1) -Filament Manager (0.5.3) -FileManager (0.1.3) -Firmware Updater (1.1.0) -GcodeEditor (0.2.6) -ipOnConnect (0.2.1) -M73-Progress-Plugin (0.1.0) -OctoKlipper (0.2.5) -PrintTimeGenius Plugin (1.3) -Tempsgraph Plugin (0.3.3) -Themeify (1.2.0)

CoDanny commented 5 years ago

Is it possible to disable/delete the "DeleteAfterPrint Plugin" to see if that fixes the issue?

Steveps3 commented 5 years ago

I recently (2 months or so) changed my printer setup so that my pi is powered directly from the printer. Since i did this I am also losing my Astroprint API setting. This only happens once a week or so. Which is quite odd. Obviously the API is being written to the memory card but something is occasionally deleting it. I am on the verge of ditching Astroprint because is becoming so annoying.

CoDanny commented 5 years ago

@Steveps3 since it was working before your change, why not looking at what changed that makes the plugin behave like this? Then we can maybe fix it.

Steveps3 commented 5 years ago

I thought that I'd explained what had changed? My raspberry pi is now powered from the printer. This means that when the printer turns off, so does the pi. There is something in the octoprint software that is just losing the astroprint API setting. This only happens maybe once a week so the problem is not as described above. The file that stores the API key is there most of the time.

CoDanny commented 5 years ago

Ok. So the problem here is that the PI is being cut off without a graceful OctoPrint shutdown? I don't think there's much we can do about this. The system will be caught off guard by a sudden loss of power. In some cases the file with the data might not have been written to the system. This is the reason OctoPrint has a software shutdown/halt that should be used before cutting power.

Steveps3 commented 5 years ago

I have tried using the shutdown and it does the same thing. Which is why I don't bother with it any longer. Also why would cutting the power delete the API setting. The API setting can be there for 4-5 power cycles and then it is gone. It just doesn't make sense. Maybe I could change the permissions on the file so that it cannot be written to once it has the API setting.

CoDanny commented 5 years ago

The same file is used to store other settings so it would depend of what the machine is doing at the time the power is cut. We'll keep looking into it. I thought this could've bee a solid lead but it appears not. We are completely UNABLE to reproduce this behavior and I would say it happens to less than 5% of the plugin users.

It's quite frustrating for us too as the first step to fix a problem is to be able to reproduce it in a controlled environment. Anyway thanks for your patience, we will eventually find this 🐛 and fix it.

Steveps3 commented 5 years ago

I am a software engineer so I totally understand your frustration. Being able to recreate a problem is half the battle. I have just spent the last 2 days trying to recreate something. I asked someone about it and they were able to show me the correct settings to recreate it. So frustrating :)

Maybe I will try the uninstall / reinstall method but I do have 2 printers and they both exhibit the same behaviour. I have considered going back to having the pi powered all the time but that has the complication that when I do turn on the printer, Octoprint doesn't automatically connect to it. So i have to "connect" manually. So I have a toss up between having to connect manually every time or having to reentered the API key once a week.

CoDanny commented 5 years ago

There's a new version (1.2.1) that adds some logging and fixes other things. Please update to it and when this error happens again, reach out so we can take a look at your log.

Steveps3 commented 5 years ago

Well it's done it again. So if you want to tell me where to find the log ans where to send it then I'll be glad to do so.

CoDanny commented 5 years ago

You can access and download files here. If you don't mind open a ticket with us to share logs. We will post back here when something relevant is found.

capture

CoDanny commented 5 years ago

Could you try installing the new version of the plugin (1.3.0) and see if this problem goes away. You might have to enter the credentials one more time after installation.

Steveps3 commented 5 years ago

Ok, I’ll try that.  Thanks

Steveps3 commented 5 years ago

It failed after just a day. Same as before, astroprint cannot find the printer. 

CoDanny commented 5 years ago

@Steveps3 I'm a bit confused but this sentence "astroprint cannot find the printer". Do you mean it disconnects from the cloud? Does it ask you for the key again when you go to your OctoPrint interface?

what do you have in the /.octoprint/data/astroprint directory?

Steveps3 commented 5 years ago

No, it simply says "no remote connections" 

CoDanny commented 5 years ago

Ok, what does the OctoPrint interface say? and also if you could look in the directory I mentioned, that would help

Steveps3 commented 5 years ago

I am not at home right now. Which is why I need astroprint to be working. I will check tonight. 

Steveps3 commented 5 years ago

That directory doesn't exist. Which might explain a few things.

sloth711 commented 5 years ago

hello

i have the same problem with the lastest version on octoprint and astroprint

after i discconnect my print 1h of plug on app android says " you need be logged"

to solve i need to re-install every time new key

please solve that

thank you