Full disk error

Hello, im having a problem with full disk space.
Container stats displays WARN because of disk is full.
I tried running: git prune and git gc but it shows:

$ git gc
error: couldn’t write .git/logs/refs/heads/master: No space left on device
error: couldn’t write .git/logs/HEAD: No space left on device
error: failed to run reflog

which i guess its because its full. I’ve heard something about using pnpm to install modules instead of package.json but im not sure. Is there a way to do that so i can use disk space without wasting it with modules? Thanks in advance, project name is: comugamersbot

Welcome to the Glitch Forum @AlonsoAliaga!

We have given you some extra disk space that should allow you to now run git prune and git gc. Be sure to do this within 24 hours as this extra space is only temporary.

Using pnpm is a good way to save disk space. Here is information about installing and use.

If you have any questions, let us know!

Thank for the quick reply, however i tried to use the commands, but i still get this

when runnning the commands

My bad @AlonsoAliaga I missed a step before giving you the extra space. I fixed the issue. You should now be able to run those commands. Let me know if it works!

Thanks! Its working now. I’ll take a look about pnpm, i guess i have to reinstall all packages and remove them from the package.json file manually right?

One more question, what about glitch edit links? If i invite someone to edit my project, but later i dont want him to edit the file anymore. I just need to remove him from the project and he cannot longer access with the link i gave him the first time? Or i need to do something else?

Edit: I also would like to know where is all my space going. What is it being used for, modules? files?

Edit 2: To use my space correctly, do i have to remove all dependencies from package.json and install one by one using “pnpm i package-name”? Or i need to remove it from other place too? Its automatic?

Glad it’s working now @AlonsoAliaga!

These are all good questions. Here is some guidance.

  • If you remove someone from a project, the invite link will no longer work.
  • To figure out where all your space is going, start by typing this command into the project console: du -hd1. This will show you whats taking up space in your project app directory.
  • If you use pnpm, you shouldn’t need to run pnpm i manually. Simply updating package.json will fix it.

Thanks for replying!
About the link question, i have that clear now, a new one will be generated to invite new people, good!
Quick question about that: If i already sent link to invite someone to edit, he didnt join the project, but i dont want him anymore in the project. Can i generate a new link without kicking someone from the project to generate a new one?

I ran the command you provided: du -hd1, this is the ouput

I dont see anything wrong with it right now (I’m running the command git prune, git gc almost every day for now)
Where was all my space going? I need to not use those commands and let the used space increase as befoire to find the problem using the command “du -hd1” when disk is full again?

About pnpm. i dont understand it at all. I’m installing the modules using package.json
I’ve read somewhere that i needed to use pnpm i module-name to install npm to not take unnecesary space in the project. But you just told me it wasnt necessary, can you tell me if installing modules using package.json takes space in my project? How can i prevent my project to run out of space correctly?

Edit: This is my container stats

Thanks for that additional information!

About invite links:
If you want to regenerate the invite link because you don’t want someone you previously invited to join, you will need to send the new invite link to others who you still want to be a project member.

About your project disk space:
Files that your project regularly changes are typically the ones taking up a bunch of space in your project’s git repository. To resolve this:

  1. Add whatever files are being changed regularly to a gitignore file
  2. Database or sqlite files are pretty common culprits here, or you can use your project’s console and run git log --stat and scroll through the results, looking for files that show up numerous times; pressing q will allow you to exit the git log process. You can also use git log --name-only --format="" | cat | sort | uniq -c | sort -nbr to get a sorted list of which files have been committed the most times in your project’s history, although that list may include files you’ve already gitignore d
  3. Open your project’s console
  4. Type git prune and <enter>
  5. Type git gc and <enter>
  6. Type refresh and <enter>

After you’ve done that you’ll have cleaned up any excess space in your project’s repo and hopefully it won’t just fill back up again, and you won’t have to run git prune and git gc every day.

About PNPM vs NPM:
Most likely moving files that are regularly changed by your project to gitignore will solve your space issues. I’m sorry if brining PNPM/NPM into the mix added to the confusion!

So you know…

  • We default to pnpm for user projects
  • enable-npm and enable-pnpm in the project console allow you to switch between the two. either also triggers a full project reinstall using the requested package manager
  • If the node_modules directory points at another directory when you look at the project structure in the project console then your project is (almost certainly) using pnpm.

No matter which package manager you’re using, just editing package.json should be enough in the most common cases to trigger a reinstall and install any updated packages, so you shouldn’t need to pnpm i - just adding it to the package file will install it.

1 Like

Thanks for the quick reply!
I added this file to my project. File called “.gitignore” with this inside.

I pruned and gc, so that will prevent my project to run out of space?
So, installing modules using package.json dont take unnecessary space?

About the links thing. So, if i kick someone from my project, that link stop working, but i need to re invite other team members? I dont understand that at all, im confused because of this:

If you want to regenerate the invite link because you don’t want someone you previously invited to join, you will need to send the new invite link to others who you still want to be a project member.

Thanks in advance!

Hi @AlonsoAliaga

Sorry it took me so long to follow up on your last question. If you were confused, it was because I was mistaken.

If you remove someone from a project, it will not affect others who are still on the project - even if they received the same invite token that you sent the user you are removing. I hope this clears things up for you!