The mysterious case of the missing Bots
# support
a
https://www.loom.com/share/205ac096976743899862fdc80cd0c64e Hey folks! After about a month-long hiatus, I returned to my project only to find my beloved bots in a peculiar state. My favorite bot, "Boff-o the Audio Transcriber," along with his bot buddies, seem to be playing an elaborate game of hide and seek. Or maybe they got swept away by the internet elves. Or are on Xmas break. 🙂 Soo... I'm on a self-hosted localhost setup: - My old bots are visible in the main Bot directory list --- but when I try to edit them individually in the Bot editor... dramatic music ... I get the message 'INTERNAL SERVER ERROR' (see the loom video above). They also don't work when I try to call them by their ID within the app. - However, new test bots work perfectly fine (the plot twist!) - All the buttons (Save/Deploy/Execute) are working and so permissions for bots seem ok The Big Question: Where oh where has my bot code gone? I can see them in the list, but all the code is gone! Any ideas or help would be appreciated. Side note: When I came back to my project, I did have to uninstall / reinstall docker -- and then designate the specific postgres database volume in docker-compose.yml -- so I don't know if that's related? Anywho... any ideas would be deeply appreciated. P.S. New bots work fine, but I miss my old ones - they had personality -- and hours of developed hard won code! 😢 #MedplumMysteries #DockerDetective #WhereAreMyBots #TechSupport @rahul1 @reshma
Also, in case this helps in the detective search: the Source code files seem absent in the main Bot > Details view -- see video? https://www.loom.com/share/1b0c624c61004dd5a097fbcf8ea53ff8
I solved it! It seems like even though I pulled over the old database into my fresh localhost install of medplum, the actual bots are not stored in the postgres or redis database -- but rather in the file structure of medplum itself. So, the solution was to run npm run dev from the packages/server directory of the old install of medplum... and then... it seemd to recover the bots so that I could at least capture some of the hard work I did to make them. Whew!
r
Glad you were able to hunt that down @albert_wong ! Yes we store Bot code using the
Attachment
datatype
Since
Attachments
. can be arbitrary binary blobs, we store them as blobs for your environment
that means S3 for AWS deployments, and filesystem for localhost
a
ah... yes, that's super helpful, thanks @rahul1 ! With that clue, I actually ended up copying over the archived packages/server/binary directory to the new localhost install -- and the bots magically reappeared on the fresh install! thanks so much. 🙂
177 Views