project_openai_codex icon indicating copy to clipboard operation
project_openai_codex copied to clipboard

401 Issue solved / render issue solved

Open crocmons opened this issue 3 years ago • 4 comments

401 Issue Solved/ Render deploy Issue: Make sure that your Server folder has no gitignore file the gitignore file should be on the root folder.. then deploy the server to render.com and add also your environment key in the Environment Variable. Now Update your fetch URL on the client side by adding your back-end render deploy URL then open your terminal and do this thing -- git init git add . git commit -m "fetch URL or something you want" git push That should be updated, your GitHub code . Now go to the vercel select your GitHub repo The root directory should be the client then hit deploy that's all ..

My code is perfectly working on the live deployment

crocmons avatar Dec 27 '22 21:12 crocmons

Thanks for sharing, but tried again, and not work for me.

Alia2006 avatar Dec 28 '22 04:12 Alia2006

@Alia2006 Make sure that your Server folder has no gitignore file the gitignore file should be on the root folder..

crocmons avatar Dec 28 '22 08:12 crocmons

@Alia2006 @rahul-0000-code @piyush-mahajan, if you still getting the 401 error and you follow every step of the video, the issue could be that when he made a cut on the video at 51:59, he starts explaining how to upload to GitHub, so naturally you "git init" and then "git add ." , then at 52:15 he starts the process all over, but before "git init" he tells us to create the ".gitignore", and then "git init" again...

So because of that, Git is tracking ".env" already because of that "git init" and "git add ." at 51:59 of the video... I believe that was an error when he was editing... that could be causing your OpenAPI Key to "Rotate" and not be valid anymore for security reasons (because it's being exposed on GitHub), so if you replace the key and push your changes again the same is going to happen...

So one of the ways you can try to fix it is by running this on the root folder terminal

"git rm .env --cached" "git commit -m "Stopped tracking .env File"

now delete the ".env" file, and push your changes again, so after that git would be stopping tracking that file, and follow the rules of ".gitignore"... now you can create the ".env" file again with the new key and push the changes... (don't forget to replace the key on the server too)

I hope it helps!

willgoncdev avatar Mar 09 '23 22:03 willgoncdev