Fix bug where the app crashes due to priviledges of making directory #791
Labels
No labels
_CRITICAL_
API
app
backEnd
Blocked, waiting for further changes
bug
cleanup
close
design
duplicate
enhancement
feature request
frontEnd
help wanted
invalid
low priority
needs input
needs review
project documentation
question
research
reviewed
script
security
SQL
style
testing
topLevel
wontfix
No milestone
No project
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Andras/BoundlessFlowCampus2K#791
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
For some reason the app crashes due to not having priviledges to create directory, we can resolve this by changing the priviledges of the frontend directory. However, that is just a temporary fix and we need somehow make the script to create the frontend directory with the right priviledges from the installation script.
Has anyone else experienced this issue?
I can not recreate this issue on the team1_week5 branch, i've tried running npm start as a admin and non admin and it works with no visible defects or bugs for both
.
This happens to me every time I clone the repo and run the install script. I use ubuntu
@b23albst wrote in #791 (comment):
How did you fix it? Do we need to add something to the script?
The fix is to do chown MY_USER frontend
Which is the Unix command to change the ownership folder frontend to the user being specified.
Unsure why the directory isnt being created with ownership to the user from the installation script.
This might be a Linux only problem, we dont know really. And as previously stated, to recreate this issue you have to make clone the repository from scratch.
I think more specifically the fix is to change the ownership of frontend/node_modules. This directory is created by the "npm install" command in the installation script and has root as owner (I'm guessing since install script is run with sudo). However, this might just be something specific to some versions/distros (I have ubuntu 22.04) since not every linux user has this problem
So i did multiple tests and found out that there might just be some lack of experience from using Linux (From my side atleast).
I am unsure why this bug appeared for the first time for me yesterday, maybe i was just lucky with my usage.
Recreating the project with not using any sudo commands for mkdir, git clone, UnixInstallation.sh, npm start will create all files with privileges to the current user. Thus, terminating the error and the issue.
However, i am not able to run UnixRebuild.sh without sudo. (Might be because docker is installed using sudo).
I also tried creating everything from scratch only using sudo. This will actually allow for npm start without using sudo.
This works flawelessly. I cant see anywhere in installation.sh or rebuildscript.sh how sudo is being enforced in anyway.
I will try to get someone else with the same issue to try this out and see if this solves the issue.
Main takeaway: use sudo for everything or nothing. if theres a mismatch where a user tries to access root privileges we get problems.
Review on #791
Whats done
I tested making new clones of the repo and running the install script, as well as the rebuild script with and without sudo
Tested on ubuntu
What needs to be done
Conclusion
An issue has been made for this problem: #877