D3SL
D3SL4mo ago

Scripts missing from flow after update

I've just updated for the first time in a while and now when I try to add a workspace script to a flow I can only see two (of 5) folders. The rest of my folders and their contents are still visible in the workspace home, and the scripts that had been added to the flow before I updated are still there. When I open any of the "missing" python scripts I'm also asked to save or discard changes despite making no alterations.
52 Replies
rubenf
rubenf4mo ago
Were the scripts in there draft only maybe ?
D3SL
D3SL4mo ago
That's never been an issue before.
rubenf
rubenf4mo ago
we changed that behavior which is why i'm asking
D3SL
D3SL4mo ago
Okay, good to know. it's not just that the scripts are missing though, the entire folder is completely gone from the flow editor. Including scripts that aren't drafts.
rubenf
rubenf4mo ago
what do you mean by folders are missing and are you sure there are scripts with not just draft_only missing from there if yes, could you share some screen of home menu and the list of the flow's script picker please
D3SL
D3SL4mo ago
Under "use pre-made action script" no scripts from that folder showed up, and the entire folder itself was missing from the selection. I did just get it to return by deploying a script.
rubenf
rubenf4mo ago
ok most likely there were only draft only scripts in there prior it's all working as intended it doesn't show folders with no relevant scripts in them
D3SL
D3SL4mo ago
Nope, many were non-draft
rubenf
rubenf4mo ago
can you share a screen of that
D3SL
D3SL4mo ago
I think what happened is it lost track of the fact some scripts had been previously deployed.
rubenf
rubenf4mo ago
it doesn't work like that
D3SL
D3SL4mo ago
Probably because I haven't updated in long enough Let me put together that screenshot
D3SL
D3SL4mo ago
Okay I feel dirty doing it this way but I don't have discord on my work machine for obvious reasons.
No description
D3SL
D3SL4mo ago
What you're seeing is folder X with a non-draft script. That folder, and it's scripts, don't show up in the flow editor.
rubenf
rubenf4mo ago
@Hugo thoughts?
D3SL
D3SL4mo ago
My guess is I jumped too many versions in a single update and what's happening is the new system doesn't realise that "send error email" script is deployed.
rubenf
rubenf4mo ago
no it doesn't work like that
Hugo C.
Hugo C.4mo ago
can you try creating a new script in the folder?
D3SL
D3SL4mo ago
Fair enough. Also is there a change log I should have been following so this change wouldn't have caught me by surprise?
Hugo C.
Hugo C.4mo ago
https://github.com/windmill-labs/windmill/releases but only draft only items should be hidden
D3SL
D3SL4mo ago
I just made a new script in that folder and deployed it. The test script and folder are now visible but not the non-test script that's previously deployed.
rubenf
rubenf4mo ago
is that script labelled as an Error Handler Kind ?
D3SL
D3SL4mo ago
There's multiple deployed scripts in that folder
rubenf
rubenf4mo ago
the one that you're saying is not showiing it probably is
D3SL
D3SL4mo ago
None of them are showing
rubenf
rubenf4mo ago
could you answer the question pl
rubenf
rubenf4mo ago
the script kind is here on the bottom right
No description
D3SL
D3SL4mo ago
Ruben you're focusing on the fact that one script that was at the top of a hasty phone screenshot was the wrong type and missing that I've got dozens of scripts that are deployed and not showing up I can take another picture of an entire folder of deployed scripts where only the two or three I've "deployed" post update are visible. It would just take longer to redact the confidential information.
rubenf
rubenf4mo ago
Doing a migration has no impact on your existing scripts, it doesn't work like that, could you please give us all the information so that, if there is a bug, we can root cause it as fast as possible that would include showing us the details of a script that should be showing and is not shown so of the right kind and non draft-only
D3SL
D3SL4mo ago
I don't know what to tell you then because I'm looking at an entire folder where every single script is deployed and only the three I've re-deployed since talking to you appear in the flow editor. They're all action scripts.
No description
No description
Hugo C.
Hugo C.4mo ago
@rubenf i think they have draft only set to true but no drafts so we don't see the badge
rubenf
rubenf4mo ago
in what situation can that arise @Hugo ?
Hugo C.
Hugo C.4mo ago
@D3SL can you look in the network tab if draft_only is set to true on those invisible scripts?
rubenf
rubenf4mo ago
alternatively, run this in your db and replace path with the right one:
select draft_only, max(created_at) from script where path = '<mypath>' group by draft_only, created_at;
select draft_only, max(created_at) from script where path = '<mypath>' group by draft_only, created_at;
D3SL
D3SL4mo ago
Where would I find the "network" tab? I might be having an "if it was a snake" moment here but I don't recall ever seeing anything labeled that
Hugo C.
Hugo C.4mo ago
I mean in the browser developer inspector
D3SL
D3SL4mo ago
OH I was looking in your UI On the workspace scripts page inspect element has no instances of "draft_only"
rubenf
rubenf4mo ago
Please run this in your db:
select draft_only, max(created_at) from script where path = '<mypath>' group by draft_only, created_at;
select draft_only, max(created_at) from script where path = '<mypath>' group by draft_only, created_at;
D3SL
D3SL4mo ago
Will do Okay took me a minute to get connected. All but three scripts are set to draft only, three have NULL values for that
Hugo C.
Hugo C.4mo ago
alright not good, what version were you on before? Have you ever manually executed SQL commands on the database? btw you can fix your problem by redeploying all the scripts
D3SL
D3SL4mo ago
Never touched the DB and I'm not sure what version I was on before. My previous docker image was created on 2024-06-08 so possibly 1.342.0.
Hugo C.
Hugo C.4mo ago
mmm then hard to say what caused the issue, can you try creating a script, saving a draft but not deploying it then returning to the home page and checking that it displays the "draft only" badge?
D3SL
D3SL4mo ago
I've just made a fine looking script (the automatic name was too perfect) and it does indeed show "draft only"
Hugo C.
Hugo C.4mo ago
alright 👍 i guess your scripts were in a buggy state, were they deployed a long time ago?
D3SL
D3SL4mo ago
Some as recently as right before I updated, but with your release schedule jumping from 1.342.0 to 1.355.2 could be considered "a long time" in terms of changing code base.
rubenf
rubenf4mo ago
no that's not a long time
D3SL
D3SL4mo ago
The only other thing I can think of is that I gave local development a shot briefly but found it more cumbersome than drafting a script, dropping it into a flow, and then iterating it right there in the flow's pop out editor. I did run into the occasional glitch when I mixed using the dedicated script editor in one tab while having the flow open in another tab and not hard-refreshing the page. There a way to bulk redeploy everything? Might be unwarranted but I'm assuming just setting the whole column to null in the scripts table would break things.
rubenf
rubenf4mo ago
it wouldn't
D3SL
D3SL4mo ago
Fantastic, thanks. Is there any kind of historic or diagnostic data I can provide that would help? Export from the DB or anything?
rubenf
rubenf4mo ago
if you can find out how those scripts were created that would be most helpful doing draft + deploy, does not result in the draft_only field being set to true so we're scratching our head how could that ever happen
D3SL
D3SL4mo ago
A combination of creating them in the browser editor and then inserting them into a flow, with lots of editing them inside the flow, and a bunch were also made locally then pushed. It's probably not this but what would happen if I added draft scripts to a flow and deployed the flow but never the scripts, could that result in the "draft" tag being removed from the UI in the workspace home but the script still being set as "draft_only"?
Hugo C.
Hugo C.4mo ago
the issue is to a save workspace script from inside the flow builder when the script is draft only, thanks for the additional info!