portainer: Editor Tab is empty if you switch to it too soon in Stack Details view

Bug description At present, if you go to any stack’s details view, and if you switch to the Stack Editor tab while the view is still loading (very common when accessing Portainer via a slow link such as a VPN), you will get an empty/blank compose file displayed in the editor because it hasn’t loaded yet. The problem is that once the view is fully loaded, you never get to see the stack compose file contents unless you reload the page and wait for the view is fully loaded before switching to the Editor tab.

Expected behavior I expect the Stack Editor tab to always contain the contents of the current stack. If loading stack data is slow, I expect to either the Stack Editor Tab to be grayed out, or the tab to appear after the stack compose file is fully loaded.

Portainer Logs I don’t think is relevant.

Steps to reproduce the issue:

  1. Go to ‘Stacks’.
  2. Click on any currently deployed Stack (where Portainer has total control).
  3. Before the stack view is fully loaded, switch to the Stack Editor tab.
  4. The Stack Editor is empty and will not be populated until you refresh the page.

Technical details:

  • Portainer version: 2.5.0 in DockerHub
  • Docker version (managed by Portainer): 20.10.6 in Swarm Mode
  • Platform (windows/linux): Linux
  • Command used to start Portainer (docker run -p 9000:9000 portainer/portainer): Swarm Stack
  • Browser: Google Chrome 90.0.4430.212 (Official Build) (64-bit)
  • Have you reviewed our technical documentation and knowledge base? Yes

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 3
  • Comments: 17 (11 by maintainers)

Most upvoted comments

I can confirm this happens to us on 2.1.1 as well. Happens with all stacks, and it is much more painfully obviously when connecting over a bad connection or VPN or anything else that slows down page load time. When I click on a stack I have to stop myself and wait until the loading bar finishes before clicking Editor, even though the tab is there taunting me to click on it as soon as it shows up because that is where I want to go.

We went with the option where you can navigate to the editor tab and the text will be filled in eventually.

Can you give it a try by using portainerci/portainer:develop and let us know how it’s working?

Yes, I just setup a testing environment in my laptop. Thanks for pointing to a CI-based image!

With portainer/portainer-ce:latest I manage to reproduce the original issue by clicking fast enough on the Editor Tab.

With portainerci/portainer:develop I see the same behaviour as in your screen recording. I still manage to click fast enough on the Editor Tab which appears initially empty but after loading the stack content, it gets filed into the editor window. So yes, I guess this is not an issue anymore in current develop 😃

However, from a user experience perspective, I think it is better and less confusing for the Editor Tab to be hidden until the stack content is actually loaded than for the Editor to be initially empty and then be populated. Pretty much like the Create template from stack button currently does.

Hope you can take this feedback into account and thanks for the help!

Interesting, this seems to be working fine in the latest Business Edition 2.7.0 release.

But I think it might actually be resolved in the 2.9.0 release. Can you give it a try by using portainerci/portainer:develop and let us know how it’s working? Note that this is a development build and should not be used in a production environment.

Was about to write up a bug report for the same thing. Running 2.5.1 CE.

I’ve noticed that the bigger the stack, and the slower the load, the more likely it is for me to click the Editor tab before it finishes loading.