WikiEducationFoundation / WikiEduDashboard

Wiki Education Foundation's Wikipedia course dashboard system
https://dashboard.wikiedu.org
MIT License
387 stars 599 forks source link

Improve Setup Script #1709

Open psinghal20 opened 6 years ago

psinghal20 commented 6 years ago

For those who faced issues with using the setup scripts, Please comment below with the errors you faced and the logs for your installation. You can find the logs in setup directory.

Sapnajha19 commented 1 year ago

Okay, can I get the slack channel link?

Sapnajha19 commented 1 year ago

While doing "sudo service mysql start" on ubuntu it says "mysql : unrecognized service". I was following this for windows setup https://github.com/WikiEducationFoundation/WikiEduDashboard/blob/master/docs/ubuntu_wsl_setup.md

marklocklear commented 1 year ago

@Sapnajha19 probably a path issue. If you try closing and opening the Linux terminal does it work? Also check this out for more help https://stackoverflow.com/questions/56985500/mysql-unrecognized-service

Sapnajha19 commented 1 year ago

Actually the service is named as mysqld instead of mysql, what should I do then?

marklocklear commented 1 year ago

Does the command mariadb work?

mysqld is the server executable (one of them) mysql is the command line client

TheTrio commented 1 year ago

Enabling systemd in WSL and then following the Linux guide should be an easier way I think. systemctl is easier to interact with than the old service commands.

Sapnajha19 commented 1 year ago

on installing rvm 3.1.2, I get this error "Error running 'requirements_debian_update_system ruby-3.1.2', please read /usr/share/rvm/log/1677160599_ruby-3.1.2/update_system.log Requirements installation failed with status: 1."

mapra99 commented 1 year ago

Hey! I tried to run the script on macOS and got the following error

WARNING! This is a work in progress script. It has been tested to work for Fedora and debian-based systems.   There are individual operating system dependent scripts being called from this one.   You can find them in setup directory. The script for windows is still not complete.   You can use them as a starting point or as a reference. If you run into any errors while running this script,   please comment with your issue on https://github.com/WikiEducationFoundation/WikiEduDashboard/issues/1709   Please upload your logs for installation with your issue reports.   The logs can be found in the setup directory. If you can help improve this script,   We would love your contributions.
Please install ruby-3.1.2 before running this script.
Your system is found to be debian-based.
Password:
setup/deb-setup.sh: line 24: syntax error near unexpected token `>'
Traceback (most recent call last):
  File "/Users/miguelprada/eng/oss/WikiEduDashboard/setup.py", line 44, in <module>
    deb_setup()
  File "/Users/miguelprada/eng/oss/WikiEduDashboard/setup.py", line 18, in deb_setup
    subprocess.run("sudo chmod 775 setup/deb-setup.sh && setup/deb-setup.sh",
  File "/Users/miguelprada/.pyenv/versions/3.10.12/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'sudo chmod 775 setup/deb-setup.sh && setup/deb-setup.sh' returned non-zero exit status 2.

I think there is an issue with the conditions that evaluate the platform at the beginning of the script. I opened #5433 with the fix that worked for me

soheilade commented 10 months ago

hi, after running python3 setup.sh, i got this issue:

[*] Installing Gems... 
Following files may not be writable, so sudo is needed:
  /usr/local/bin
  /var/lib/gems/3.1.0
  /var/lib/gems/3.1.0/build_info
  /var/lib/gems/3.1.0/bundler
  /var/lib/gems/3.1.0/cache
  /var/lib/gems/3.1.0/doc
  /var/lib/gems/3.1.0/extensions
  /var/lib/gems/3.1.0/gems
  /var/lib/gems/3.1.0/plugins
  /var/lib/gems/3.1.0/specifications
Using mediawiki_api 0.7.1 from https://github.com/ragesoss/mediawiki-ruby-api (aUsing rapidfire 2.1.0 from https://github.com/WikiEducationFoundation/rapidfire Using piwik_analytics 2.0.0 from https://github.com/ragesoss/piwik-ruby-trackingUsing omniauth-mediawiki 0.0.2 from https://github.com/ragesoss/omniauth-mediawiki.git (at master@d785f4d)Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

trying to redo with sudo python3 setup.sh:

i get this error:


[*] Installing bundler... 
bundler already installed
[*] Installing Gems... 
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and installing your bundle as root will break this application for all non-root users on this machine.
Using piwik_analytics 2.0.0 from https://github.com/ragesoss/piwik-ruby-tracking (at master@1181569)Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

any idea how to solve this?

prathamVaidya commented 9 months ago

While running the Setup Script in Ubuntu 22.04 LTS, mysql2 gem cannot be installed. Reason being this libmariadbclient-dev package is not available from the default repositories. This gave an error during mysql2 gem installation. I fixed it by installing this package libmariadb-dev as an alternative. Should it be updated in the Setup Script deb-setup.sh as well?

ragesoss commented 9 months ago

While running the Setup Script in Ubuntu 22.04 LTS, mysql2 gem cannot be installed. Reason being this libmariadbclient-dev package is not available from the default repositories. This gave an error during mysql2 gem installation. I fixed it by installing this package libmariadb-dev as an alternative. Should it be updated in the Setup Script deb-setup.sh as well?

Yes, I think that makes sense.

prathamVaidya commented 9 months ago

Ok, i'll update and raise a PR.

Nikuunj commented 9 months ago

I have some experience in programming languages like html , css , js , react . I am passionate about open-source and have recently participated in Hacktoberfest 2023. I am now seeking mentorship to improve my skills in open-source development. I am keen to contribute to your projects and would appreciate your guidance on how to get started.

shruti862 commented 9 months ago

After setting up the development environment and starting it by running guard command ,this is what is showing to me ,how to resolve this Screenshot from 2023-12-11 13-45-20

prathamVaidya commented 9 months ago

@shruti862 please mention the following details:

shruti862 commented 9 months ago

@prathamVaidya

I am using Ubuntu. No I haven't encountered any errors while running the script

TheTrio commented 9 months ago

See the logs where you ran guard. That should be a good starting point to figure out what's wrong.

shruti862 commented 9 months ago

I am unable to figure out the problem from the logs.

shruti862 commented 9 months ago

Screenshot from 2023-12-11 14-56-12 @prathamVaidya @ragesoss This is the error I am encountering right now

prathamVaidya commented 9 months ago

@shruti862, the error you're encountering may be due to an incomplete MySQL setup. There is a logic to create a mysql account automatically, that might have failed during the setup script. which ubuntu version are you using? There must be some trace of failure in the setup log.txt. can you upload your log.txt and provide a link to it. Also are you using the latest pull? I fixed an error related to same issue few days ago.

shruti862 commented 9 months ago

log.txt This is my log file @prathamVaidya I am using Ubuntu 22.04.3 I don't know how to create automatic mysql account

prathamVaidya commented 9 months ago

Here is your error: Building dependency tree... Reading state information... Package libmariadbclient-dev is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source However the following packages replace it: libmariadb-dev-compat libmariadb-devc This package is not available on latest versions of ubuntu. I have fixed this issue in the script. It looks like you might be using an older version of master. Please confirm you are using master branch and do a git pull or sync fork (if using fork).

shruti862 commented 9 months ago

I cloned the repo from the master branch to my local system

prathamVaidya commented 9 months ago

can you use this command and tell what is the output:

sudo apt-get install -y libmariadb-dev

shruti862 commented 9 months ago

Screenshot from 2023-12-11 15-29-43

prathamVaidya commented 9 months ago

Found the reason. Installation is perfect. You have not run yarn start After running guard run yarn start in different terminal. Then the web page should be available.

prathamVaidya commented 9 months ago

Screenshot from 2023-12-11 14-56-12 @prathamVaidya @ragesoss This is the error I am encountering right now

though this is still unclear why. let me know if it works after the yarn command.

shruti862 commented 9 months ago

I tried yarn start after guard command ,but still getting same error Screenshot from 2023-12-11 15-59-25

shruti862 commented 9 months ago

Screenshot from 2023-12-11 16-02-41 I am getting this thing while manually starting reddis server,

prathamVaidya commented 9 months ago

Screenshot from 2023-12-11 16-02-41 I am getting this thing while manually starting reddis server,

That is not a problem. The redis-server is already running that's why the port is already busy.

prathamVaidya commented 9 months ago

I tried yarn start after guard command ,but still getting same error Screenshot from 2023-12-11 15-59-25

You can temporarily fix the issue by running these sql commands in mysql.

run sudo mysql

then enter following commands.

CREATE USER 'wiki'@'localhost' IDENTIFIED BY 'wikiedu';
GRANT ALL PRIVILEGES ON dashboard . * TO 'wiki'@'localhost';
GRANT ALL PRIVILEGES ON dashboard_testing . * TO 'wiki'@'localhost';

Try restarting guard again. IDK, why the script failed to run those.

shruti862 commented 9 months ago

@prathamVaidya Issue resolved ,Thanks for ur help !

kan-ish commented 8 months ago

@prathamVaidya I am encountering the same issue as @shruti862 here while trying to setup the project on my local. Though I am running OSX. Screenshot 2023-12-15 at 22 28 05 Screenshot 2023-12-15 at 22 32 03 log.txt

I suspect the issue might be related to mysql setup, as there was a hiccup during the setup while populating the db. I tried running these commands as advised by you to Shruti -

You can temporarily fix the issue by running these sql commands in mysql.

run sudo mysql

then enter following commands.

CREATE USER 'wiki'@'localhost' IDENTIFIED BY 'wikiedu';
GRANT ALL PRIVILEGES ON dashboard . * TO 'wiki'@'localhost';
GRANT ALL PRIVILEGES ON dashboard_testing . * TO 'wiki'@'localhost';

Try restarting guard again. IDK, why the script failed to run those.

This didn't resolve it. Could you help me figure out what the problem might be?

prathamVaidya commented 8 months ago

@prathamVaidya I am encountering the same issue as @shruti862 here while trying to setup the project on my local. Though I am running OSX. Screenshot 2023-12-15 at 22 28 05 Screenshot 2023-12-15 at 22 32 03 log.txt

I suspect the issue might be related to mysql setup, as there was a hiccup during the setup while populating the db. I tried running these commands as advised by you to Shruti -

You can temporarily fix the issue by running these sql commands in mysql.

run sudo mysql

then enter following commands.

CREATE USER 'wiki'@'localhost' IDENTIFIED BY 'wikiedu';
GRANT ALL PRIVILEGES ON dashboard . * TO 'wiki'@'localhost';
GRANT ALL PRIVILEGES ON dashboard_testing . * TO 'wiki'@'localhost';

Try restarting guard again. IDK, why the script failed to run those.

This didn't resolve it. Could you help me figure out what the problem might be?

Logs didn't show any signs of failure. Can you confirm if you have run yarn start or build command to generate frontend build.

If yes, there must be some error message when running the guard command. Check and share that.

kan-ish commented 8 months ago

I restarted everything and the issue seems to be resolved now (still don't know what the issue was). I restarted Redis, ran guard and yarn start again and the frontend did load. Although it was pretty slow (> 60 seconds). I restarted my machine and now everything seems to be running fine and as expected (seems like a machine issue but worth mentioning).

Thanks for the quick reply though!

liaozhuzhu commented 8 months ago

Running into 2 errors when I run python3 setup.py.

*[] Installing MariaDB-server... Warning: mariadb 11.2.2 is already installed and up-to-date. To reinstall 11.2.2, run: brew reinstall mariadb Bootstrap failed: 5: Input/output error Try re-running the command as root for richer errors. Error: Failure while executing; /bin/launchctl bootstrap gui/501 /Users/liaozhu/Library/LaunchAgents/homebrew.mxcl.mariadb.plist exited with 5.**

2. [] Creating User for Mysql... ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) [] Migrating databases... rake aborted! ActiveRecord::ConnectionNotEstablished: TLS/SSL error: No such file or directory (2) Caused by: Mysql2::Error::ConnectionError: TLS/SSL error: No such file or directory (2) Tasks: TOP => db:migrate (See full trace by running task with --trace) rake aborted! ActiveRecord::ConnectionNotEstablished: TLS/SSL error: No such file or directory (2) Caused by: Mysql2::Error::ConnectionError: TLS/SSL error: No such file or directory (2) Tasks: TOP => db:migrate

Log File: log.txt

I am running MacOS and have been stuck on this issue for several hours now. Thank you

SainiAditya1 commented 8 months ago

@prathamVaidya I am getting internal server error then done the changes suggested by you above , Then I am getting this Screenshot from 2024-01-06 18-04-51

prathamVaidya commented 8 months ago

@prathamVaidya I am getting internal server error then done the changes suggested by you above , Then I am getting this Screenshot from 2024-01-06 18-04-51

Looks like you are opening the project from PORT 8080, use PORT 3000.

in one terminal use yarn start to start react project with live server. and in another terminal use guard to start ruby on rails.

In this project react application is build and then served by ruby on rails server. So you need to start both and then access the application at PORT 3000 and not 8080 (I believe its only for serving static assets and for syncing live changes).

SainiAditya1 commented 8 months ago

I have made the above changes it still showing this Screenshot from 2024-01-06 20-02-53

SainiAditya1 commented 8 months ago

@prathamVaidya Please have a look

prathamVaidya commented 8 months ago

Looks like some issue from backend. Please provide logs or error screenshots of the guard command.

SainiAditya1 commented 8 months ago

Screenshot from 2024-01-07 11-03-38

prathamVaidya commented 8 months ago

No errors in the SS.

SainiAditya1 commented 8 months ago

@prathamVaidya ,Now it's working fine with database migrations bin/rails db:migrate RAILS_ENV=development . Thanks for all your suggestions .

SainiAditya1 commented 8 months ago

Screenshot from 2024-01-07 11-48-58