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

Octoprint GUI asks for a reload even though there is no new server (but after a client sleep) #2950

Closed
Mirarkitty opened this issue Dec 12, 2018 · 15 comments
Labels
bug Issue describes a bug needs information More information is needed to further process this issue or PR triage This issue needs triage

Comments

@Mirarkitty
Copy link

What were you doing?

Opening Octoprint interface tab in my browser.

  1. open octoprint in browser
  2. set computer to sleep (not tested: pick another tab first)
  3. wake up computer
  4. octoprint now asks PLEASE RELOAD even though nothing has changed on server

What did you expect to happen?

Octoprint behaving nicely without PLEASE RELOAD.

What happened instead?

Octoprint asks PLEASE RELOAD.

Did the same happen when running OctoPrint in safe mode?

Not tested. Doesn't seem relevant.

Version of OctoPrint

Operating System running OctoPrint

OctoPrint 1.3.10 running on OctoPi 0.15.0PE

Browser and version of browser, operating system running browser

Mozilla Firefox 63 under Linux.

Link to contents of Javascript console in the browser

Will check next time it happens.

Screenshot(s)/video(s) showing the problem:

image

...I have read the FAQ.

@GitIssueBot GitIssueBot added the triage This issue needs triage label Dec 12, 2018
@foosel
Copy link
Member

foosel commented Dec 12, 2018

Thank you for reporting this!

Sadly your report lacks some of the information that is needed in order to look into this issue:

(If you need help with locating this stuff, please take a look into the Contribution Guidelines which explains everything - and if anything is still unclear then just ask)

Could you please provide that so this issue can be analyzed and ideally reproduced and fixed? Thank you!

@foosel foosel added the needs information More information is needed to further process this issue or PR label Dec 12, 2018
@Mirarkitty
Copy link
Author

If you think safe mode and octoprint.log will help; I think it's a client javascript issue. I will provide.

@Mirarkitty
Copy link
Author

Mirarkitty commented Dec 15, 2018

Javascript or log didn't seem to give anything useful.

...it seemed more useful that I'll start debugging. So far,

            if (versionChanged || pluginsChanged || configChanged) {
                console.log("dataupdater",versionChanged,pluginsChanged,configChanged);
                showReloadOverlay();
            }

yielded false false true. I'll pursue some more.

@foosel
Copy link
Member

foosel commented Dec 17, 2018

That raises the question why the config keeps changing. Now would be a good time to take a look at the network tab of the browser developer console, check if there are any settings save requests being fired by the UI. Otherwise it's something happening in the backend.

Also something to check is why this code part is even being called in the first place since it should only trigger after a reconnect. So you should also take a look at the network tab for that

@Mirarkitty
Copy link
Author

Mirarkitty commented Dec 17, 2018

It does reconnect (I'm not sure what's in a connection, but the computer is sleeping for more than an hour) and the config hash is changing. I'll try to see why, is it suppose to change on reconnect?

onconnect hash 81528b6f491e636669947280a5791b7e 77469fdc74e2995dd13556843c32208c packed_core.js:13683:6
Connected to the server packed_core.js:13722:9
dataupdater false false true packed_core.js:13715:3
config hash 81528b6f491e636669947280a5791b7e 77469fdc74e2995dd13556843c32208c packed_core.js:13716:3

(blah) hash (old) (new)

@foosel
Copy link
Member

foosel commented Dec 17, 2018

I'll try to see why, is it suppose to change on reconnect?

No, not unless something has updated the config in the meantime. The hash is basically a hash over the currently effective config. That usually shouldn't change all the time. The thing is that a change in the config can have consequences for the generated HTML code (also in the code of third party plugins, hence I cannot just use a whitelist here to limit detected changes to only those affecting the HTML code). Hence the prompt to reload.

It does reconnect (I'm not sure what's in a connection, but the computer is sleeping for more than an hour)

Ah, sorry, I forgot that this was happening after sending the computer to sleep.

@Mirarkitty
Copy link
Author

where is data["config_hash"]; generated? (And which packet does it come in?)

@Mirarkitty
Copy link
Author

Never mind, I think I found it...

        @property
        def config_yaml(self):
                import yaml
                return yaml.safe_dump(self._config)

        @property
        def config_hash(self):
                import hashlib
                hash = hashlib.md5()
                hash.update(self.config_yaml)
                return hash.hexdigest()

Lets see if I can dump the two configs and see what's changed...

@Mirarkitty
Copy link
Author

I found it! It's the telegram plugin:

-rw-rw-r-- 1 pi pi 4579 Dec 18 06:21 config.yaml
-rw-r--r-- 1 pi pi 4579 Dec 17 21:18 config.yaml.bup
-rw-rw-r-- 1 pi pi 3149 Oct 23 07:43 config.yaml~
pi@octopi:~/.octoprint$ diff config.yaml config.yaml.bup 
143c143
<         image: /plugin/telegram/img/user/pic75232830.jpg?1545114108170
---
>         image: /plugin/telegram/img/user/pic75232830.jpg?1545065971005

@Mirarkitty
Copy link
Author

Moving issue there. fabianonline/OctoPrint-Telegram#156

@Mirarkitty
Copy link
Author

Thanks for the help.

@foosel
Copy link
Member

foosel commented Dec 18, 2018

Glad you found out what's up!

@mark-hahn
Copy link

mark-hahn commented Mar 11, 2019

I'm having the same problem and I'm not running telegram or tpsmartlink.

@jneilliii
Copy link
Contributor

jneilliii commented Mar 11, 2019

Do you have any of my power plugins installed?

@Mirarkitty
Copy link
Author

Easiest is to find the config file, copy it, next time it asks for a reload do a diff and see what changed in the config. It will point you directly to the issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue describes a bug needs information More information is needed to further process this issue or PR triage This issue needs triage
Projects
None yet
Development

No branches or pull requests

5 participants