getumbrel / umbrel

A beautiful home server OS for self-hosting with an app store. Buy a pre-built Umbrel Home with umbrelOS, or install on a Raspberry Pi or any x86 system.
https://umbrel.com
Other
7.15k stars 519 forks source link

App store empty after installing / removing development app #1563

Open j-5-s opened 1 year ago

j-5-s commented 1 year ago

I'm trying to install a basic react app following the documentation on here. After installing my app it removed all apps from the UI so umbrel.local showed none of my previously installed app. Also the settings page showed 0's for storage and ram as well as no apps in the app store. After uninstall the app the original apps came back to the homepage and the settings appears correct, however the store is still empty. Looking for solution on how to fix the app store as well as what is wrong with my custom app that broke it.

Steps to reproduce the issue (im running on a new raspberry pi 4)

  1. ssh umbrel@umbel.local
  2. cd umbrel
  3. sudo ./scripts/repo checkout https://github.com/jamescharlesworth/umbrel-apps.git
  4. sudo ./scripts/app install react-app After doing this command the homepage and settings and search is empty Screen Shot 2022-11-30 at 7 56 38 PM Screen Shot 2022-11-30 at 7 56 30 PM Screen Shot 2022-11-30 at 7 58 52 PM
  5. (remove the app) sudo scripts/app uninstall react-app this does not appear to have completed successfully with the following output:
    umbrel@umbrel:~/umbrel $ sudo scripts/app uninstall react-app
    Removing images for app react-app...
    Stopping react-app_web_1       ... done
    Stopping react-app_app_proxy_1 ... done
    Removing react-app_web_1       ... done
    Removing react-app_app_proxy_1 ... done
    Network umbrel_main_network is external, skipping
    Removing image getumbrel/app-proxy:v0.5.2@sha256:a2e3e0ddfcf84838bf0ba66f4b839ec958832d51f0ac9ace47962459c838b2d6
    ERROR: Failed to remove image for service app_proxy: 409 Client Error for http+docker://localhost/v1.41/images/getumbrel/app-proxy:v0.5.2%40sha256:a2e3e0ddfcf84838bf0ba66f4b839ec958832d51f0ac9ace47962459c838b2d6?force=False&noprune=False: Conflict ("conflict: unable to remove repository reference "getumbrel/app-proxy:v0.5.2@sha256:a2e3e0ddfcf84838bf0ba66f4b839ec958832d51f0ac9ace47962459c838b2d6" (must force) - container c5cf17c2b956 is using its referenced image 4df2a4dd2ffd")
    Removing image jamescharlesworth/react-my-app:v0.0.1
    Deleting app data for app react-app...
    Removing app react-app from DB...
    Successfully uninstalled app react-app

    The homepage and settings is restored after doing this but app store is still empty:

Screen Shot 2022-11-30 at 7 58 37 PM

Screen Shot 2022-11-30 at 7 58 45 PM

Also after installing the app it does run and is working, running on port 3002:

Screen Shot 2022-11-30 at 8 45 24 PM

j-5-s commented 1 year ago

Looks like this is due to not including some required fields in umbrel-app.yml

from looking at the logs in the manager container getumbrel/manager:v0.5.3 logs I see

2022-12-01T12:00:34.718Z ERROR: undefined [/v1/apps?installed=1] Cannot read property 'map' of undefined {"data":"TypeError: Cannot read property 'map' of undefined\n    at /app/logic/apps.js:66:31\n    at Array.map (<anonymous>)\n    at addAppMetadata (/app/logic/apps.js:56:15)"}

so its failing cause gallery is not defaulted to an empty array here.

After fixing that in my umbrel-app.yml (branch with fixes) I found that dependencies is required as well others the frontend app and is throwing an error here.

Fixes those two things makes all things work as expected. What i have not figured out is why installing the broken app and then removing it persists some broken state so that the app store page is still broken. Some install command is maybe updating a json file somewhere and on uninstall doesn't get cleaned up?

nevets963 commented 1 year ago

@jamescharlesworth Thanks for reporting this issue. We're moving as quickly as possible to improve the overall developer experience with Umbrel. As you can tell, this is definitely a shortcoming on our part and we'll improve on this ASAP!

chevdor commented 1 year ago

I am running into the same issue. Where are the logs that could hint at what the problems are ?

j-5-s commented 1 year ago

iirc ssh into the device and from the ~/umbrel directory run:

docker-compose logs
chevdor commented 1 year ago

I figured out a few points that may help:

Using sudo and docker can be confusing. I suggest people running into issue to check the content of /root/umbrel/repos and $HOME/umbrel/repos.

As first tip, I would suggest not using sudo but using sudo -i once and then running all commands without sudo to ensure 100% of the commands are done as root.

Still if adding a repo fails, reboot and try again. I know how it sounds but it fixed it for me twice.

MetyTwister commented 1 year ago

I am having the same issue, any updates?

chevdor commented 1 year ago

So far the only convenient option I found is to replace the main store with my branch with a checkout. That excludes all the official apps but at least I can see my changes. While this is no solution, it allows moving on at least. I think that an issue remains since the sample repo does work whereas a practically identical user repo fails. I suspect a bug and if this is not the same, some script to check a repo could be useful.