Automatically deleting data/config.yml

Hi @LightningsFury! I’m not sure exactly what you mean - are you seeing some error messages? Can you share your project name, or at least your package.json file?

I’m getting an error from the project as if I haven’t added a config file, which I have. However, when I refresh the config file is gone as if I’ve just cloned the repo. The project is widgetboat

When I check those logs everything looks fine (or at least I’m not seeing any errors), so maybe you resolved this in the interim. Was this the file in data/config.yml?

I got rid of everything in gitignore and it seems config.yml doesn’t seem to be disapearing after I create it
However, the project still acts as if I don’t have a config.yml

Where are you seeing that? I don’t see anything in the logs complaining about a missing config file.

If your config.yml file seemed to be disappearing because of something in the .gitignore file then it was just being hidden from the editor. Your code wouldn’t have had any difficulty reading it. Using refresh in the console would resync the editor and the backend (including the contents of your .gitignore file) which could make it seem as though the file was disappearing. However if you executed cat data/config.yml in the console you would see its contents.

Hm, I redid the project in my home pc without a config file and it gave the same error. I was thinking it was the config file that caused the problems. Oh and the project worked smoothly on my pc anyway. I’ll see if I can look into it more. Btw, I locked my project, how do you have access?

Some Glitch staff have access to all projects, and will access them under certain circumstances (among them being requests for help). See Updates to Glitch's policy regarding private projects for more details, and feel free to ask for any clarifications.

1 Like

Hey cori, so did more local tests, and I only get the error too when dependencies aren’t installed with yarn, but with npm. If you can, could you install all my dependencies with the command yarn on the project, thanks

EDIT: Used npm to install yarn, and then added that as a prestart. However, yarn is saying that I don’t have space to install the modules which is a problem. Could you increase the space I have in that project?

EDIT 2: Yeh so I messed around in the console with node_modules and yarn, and I’ve pretty much broken the project as I can’t install anything anymore. :expressionless:
The problem is yarn cache takes up alot of space, but can be cleaned. I need an ounce more space so I can install the modules and clear the cache without errors. Thanks

Sorry @LightningsFury, I apologize for not responding earlier; I missed the edits you made.

I’ve raised your project’s disk space limitation temporarily to give you the space you need to manage your yarn cache. This will revert to the standard disk space in 24 hours.

Good Luck!

Are you sure nobody else has access to the project. It seems my bot token has been infiltrated and it’s been sending virus links at me, the only place where someone could find the token is glitch

Oh and thanks, I’ll look at it rn

Okay, it went further and gave me the error again. Lmao, there’s alot of dependencies on this project, first time porting a large project to glitch. Right now, I have no clue what I’ve done to the project for npm to also start breaking. Could you revert my npm and non-project filesystem to what it was before I started messign around

You should be able to revert to a point that precedes the current problems by using the Rewind feature. If you click the image button under your project’s name you can see the history of the project and rewind back to a happier time.

Okay, I’ll try that thanks. Also, 350mb is used up by node modules, and with yarn cache it peaks at 750~, but after clearing cache, it goes to 350mb

As far as whether others have access to the project I see that it’s now private, but at one point it was public if I recall correctly. Since you’re not storing your secret data in your .env file if someone remixed it while it was public they would get a copy of all of those secrets. If you believe that’s happened then I would suggest you roll the token for your bot and update your project with the new token. I’d also suggest you move that information into the .env file and use it from there.

For your disk space problem, if you’re really using that much space in node modules than the solution is to run enable-pnpm in the console to off-load the node modules space to a volume that doesn’t figure in your project’s disk space calculations.

Okay, I’ve reverted my project. Not sure how .env is used in a yml file though. Anyway, I’ll try what you’ve asked

That’ll depend on how the framework you’re using processes the config file - some frameworks have special syntax for interpolating environment variables (which is what .env contains) in yaml files. It looks like your framework allows javascript config files which might work better?

Alternatively you could put your config file in a hidden folder (such as .data) to hide it from remixing. That would mean you’d have to edit it in the console, though.

I looked and did not see any projects remixed from this one, so I don’t think that’s how your config leaked, if that’s what’s happening.

Finally it’s starting to run, but it seems to be just on the starting page on the actual site. Any clues?

Yep! That means that your project isn’t ever listening to the expected port. Until Glitch sees that it’s listening to the port referenced by process.env.PORT (usually 3000 but will change under some circumstances) it will keep trying to restart your project. That’s often handled, even in bots, by exposing a route to “/” and opening a listener to process.env.PORT.

I see that your project seems to be listening on 7000 (I didn’t go hunting for where that’s loaded from). If you change that to process.env.PORT then you’ll stop seeing the continual starting. I don’t think you’ll be able to listen to 7000 in any case - we don’t expose that port.

Okay thanks, the port is in the config.yml file which I again dunno how to use. Anyway, I’m getting another error which I haven’t gotten on windows, I have to also look into that. But for now, thanks

NPM just ran when I restarted and broke everything. I pretty much give up now, but 'tis was fun!