Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

/moodle\\login/token.php was not found on the server #7

Closed
ManoloZocco opened this issue Feb 19, 2020 · 6 comments
Closed

/moodle\\login/token.php was not found on the server #7

ManoloZocco opened this issue Feb 19, 2020 · 6 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@ManoloZocco
Copy link

Hi everyone, when I set up the moodle account i receive this errors:
Error while communicating with the Moodle System! (An Unexpected Error happened on side of the Moodle System! Status-Code: 404 Header: [('Date', 'Wed, 19 Feb 2020 10:01:18 GMT'), ('Server', 'Apache/2.4.7 (Ubuntu)'), ('Content-Length', '304'), ('Content-Type', 'text/html; charset=iso-8859-1')] Response: b'<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">\n<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p>The requested URL /moodle\\login/token.php was not found on this server.</p>\n<hr>\n<address>Apache/2.4.7 (Ubuntu) Server at elearning.unisi.it Port 443</address>\n</body></html>\n') Please try again.

but as you can see the token.php page is on the server: https://elearning.unisi.it/moodle/login/token.php and in https://elearning.unisi.it/moodle//login/token.php

What can i do? can i manually extract the token and pass it to the software?
Thanks in advance!

@shoeper
Copy link
Contributor

shoeper commented Feb 19, 2020

Have you configured moodle as location? Don't know the exact name but there is a setting for the path / location of moodle.

@C0D3D3V
Copy link
Owner

C0D3D3V commented Feb 19, 2020

Interesting bug, but it works fine for me.
Please try to use https://elearning.unisi.it/moodle/ as URL of Moodle

URL of Moodle:   https://elearning.unisi.it/moodle/
Username for Moodle:   guest
Password for Moodle [no output]:   guest
Login Failed! (The Moodle System rejected the Request. Details: Non ci sono ospiti qui! (Errorcode: noguest, Stacktrace: None, Debuginfo: None, Reproductionlink: None)) Please try again.

If that doesn't work either, I can explain how you can get the token manually.

@C0D3D3V C0D3D3V added the help wanted Extra attention is needed label Feb 19, 2020
@ManoloZocco
Copy link
Author

ManoloZocco commented Feb 19, 2020

Thanks for the reply. I followed your instructions but I keep having the same error. I paste the exact procedure I do. I also checked the requirements.

c:\path_to_MD2> pip3 install -r requirements.txt
Requirement already satisfied: sentry_sdk>=0.13.5 in c:\path\to\python\python37\lib\site-packages (from -r requirements.txt (line 1)) (0.14.1)
Requirement already satisfied: certifi in c:\path\to\python\python37\lib\site-packages (from sentry_sdk>=0.13.5->-r requirements.txt (line 1)) (2019.6.16)
Requirement already satisfied: urllib3>=1.10.0 in c:\path\to\python\python37\lib\site-packages (from sentry_sdk>=0.13.5->-r requirements.txt (line 1)) (1.25.3)

c:\path_to_MD2> python main.py --init
Do you want to override the existing config [y/n]?   y
Do you want to activate Notifications via mail [y/n]?   n
Do you want to configure Error Reporting via Sentry? [y/n]n
[The following Credentials are not saved, it is only used temporarily to generate a login token.]
URL of Moodle:   https://elearning.unisi.it/moodle/
Username for Moodle:   myuser.name
Password for Moodle [no output]:
Error while communicating with the Moodle System! (An Unexpected Error happened on side of the Moodle System! Status-Code: 404
Header: [('Date', 'Wed, 19 Feb 2020 13:29:36 GMT'), ('Server', 'Apache/2.4.7 (Ubuntu)'), ('Content-Length', '304'), ('Content-Type', 'text/html; charset=iso-8859-1')]
Response: b'<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">\n<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p>The requested URL /moodle\\login/token.php was not found on this server.</p>\n<hr>\n<address>Apache/2.4.7 (Ubuntu) Server at elearning.unisi.it Port 443</address>\n</body></html>\n') Please try again.
URL of Moodle:

@ManoloZocco ManoloZocco changed the title /moodle\\login/token.php was not found on the server [question] /moodle\\login/token.php was not found on the server Feb 19, 2020
@C0D3D3V
Copy link
Owner

C0D3D3V commented Feb 19, 2020

Ok, I could reproduce the bug now, it only exists under Windows. It doesn't occur under Linux.
It doesn't help to generate the token manually. I'll do some testing and try to fix the bug quickly.

You could however try to generate a token and then create a config.json like I explained here

To generate a token you need to visit this link:
https://www.yourmoodle.com/login/token.php?username=USERNAME&password=PASSWORD&service=moodle_mobile_app

Replace USERNAME and PASSWORD with your username and password.

@C0D3D3V C0D3D3V added the bug Something isn't working label Feb 19, 2020
@ManoloZocco
Copy link
Author

Generating the token, and putting the information in the json file, everything worked perfectly. Thanks so much!

@C0D3D3V
Copy link
Owner

C0D3D3V commented Feb 19, 2020

I uploaded an update 49e5b4e.
If you find any other bugs under windows, you are welcome to report them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants