Serverless Function: "File not found"
Hey!
I try to just update a field with "Total Contract Value" that is just a commitment*amount
but the flow is crashing with "File not found" error...
Any help is pretty welcomed!
thanks!


35 Replies
Hi @Absynth, could you check devtools if there's any meaningful message? I've tried your case with code below and it works

Thanks for your answer!
the problem is not in the test that is also working on my end, but in the fact that when I launch the workflow, it's never working :/.
I have not found meaningful message in the console, but I can try to find one. If I look at the console when modifing the opportunity to trigger, it does not give much...





That's weird, I don't see a reason why this shouldn't work, are you self-hosted by any chance? If so, could you check if there's any useful related log?
Also, could you send the state of workflow from last run?
Yes sorry I'm self hosted on railway.
Last version 1.2.1
You are right, this is what I just got in the Worker's logs (by just activating the workflow)
I created a full new workflow and did the same thing with the snippet you sent, still the same result
I don't know if it's normal, but in the files it seems that the serverless function is in a
draft
folder



@Prastoin could you please take a look? My knowledge about inner workings of workflow is limited in this case
@thomast could you please have a look to this when you have some free time ?
@martmull
@Absynth Workflows are run by the server when you use test, but when you launch it, workflow are run by the worker. Worker and server must share the same localStorage memory for workflows to run properly. If not, worker can't access code step code file and fails to run them. You need to use an s3 like storage system
We mentioned that in the doc, albeit somewhat discreetly https://twenty.com/developers/section/self-hosting/docker-compose#persistence
As you are self hosting on Railway, their is something you can use, give me 2s to find it
Yes sorry I'm self hosted on railway. Last version 1.2.1https://railway.com/deploy/nAL3hA @thomasmol fyi
Railway
Deploy Twenty CRM
Deploy Twenty CRM on Railway with one click, start for free. Deploy latest version of Twenty CRM (v1.*) on Railway
yes, I have updated my message after checking history my bad 😅
no prob, thanks for helping!
I think this is https://railway.com/deploy/SMKOEA
Railway
Deploy MinIO
Deploy MinIO on Railway with one click, start for free. Open source object storage with an S3 compatible API
hum... I already have minIO in the template I use
ok
all you workflow with code step cause the same issue?

never succeded into making them work indeed.
Ok when looking at the picture you provide, I don't see a direct link from twenty worker to Bucket. Also, what is this link between twenty worker and twenty (I assume twenty is server)?
the links are done automatically when a ressource is used by another service if I'm correct.
Like if they share secrets
Would it be as easy as adding the right secrets to the worker, or is it a bit more complex? (just asking, if it's the case.. that would be great)
I think it is just that, I would try that at first
🤞
yea i think you can just add the env vars related to the storage to the worker service as well?
hey @thomasmol ! thanks for joining (sorry for the "summon" but the template being yours... it might be interesting for you!).
you mean all those?

maybe
STORAGE_TYPE
tooyes
STORAGE_TYPE
and this onelet's go, I'll test right away and tell you
oooh it worked
- workflow status that was glitchy is now active as intended
- the workflow did run successfully.
Well done guys!
@thomasmol is the modification I've done steady or do you need to update your template?
@martmull , @ɃØĦɆᵾS @thomasmol ( @thomast and @Prastoin too) you have my thanks!

ahh very cool
Great! Pleased to see it works
Happy to see your issue resolved!
@Absynth yea i'll update the template description with info about setting up S3 for this. I think Railway is working on making the storage volumes accessible from multiple services, but right now that is not possible. So you'd have to use some type of S3 compatible storage for this
no prob for me!
my question was more: will the next deployment "touch/change" the secrets in the worker?
i am actually not sure template updates are done automatically like that. I hope it doesn't, because it could break deployments for others?
you are totally right!
Hopefully only the new ones will be impacted 😆