matecat / MateCat

MateCat is an AI driven translation tool for language industry professionals. Matecat makes machine translation post-editing and project outsourcing easy.
http://www.matecat.com
GNU Lesser General Public License v3.0
368 stars 179 forks source link

Problem in Google + auth (logs included) #1842

Closed vinayaksharmagh closed 3 years ago

vinayaksharmagh commented 3 years ago

I have obtained the google + credentials as said in the instructions. When I click on sign with google it works fine till 2 steps i.e "Choose Your Account" and "Confirm your choices" . But once I click Allow on "Confirm your choices". It throws "HTTP 500, local host is unable to handle this request"

Screenshot (308) Screenshot (309) Screenshot (310) Screenshot (311)

google_client_logger.log


{"message":"Service Call","context":{"service":"oauth2","resource":"userinfo","method":"get","arguments":[]},"level":200,"level_name":"INFO","channel":"google_client_logger","datetime":{"date":"2020-11-04 06:34:24.078035","timezone_type":3,"timezone":"Asia\/Calcutta"},"extra":[]}

err_mail.log


{"log":{"token_hash":"5fa1faa595391","context":{"ip":"127.0.1.1","class":"TaskRunner\Executor","function":"update","line":409},"time":1604451864,"date":"2020-11-04T06:34:24+05:30","content":"--- (Worker 2639:vinayak:0) : Wrong configuration data found. Ensure that 'TaskRunner\Commons\Params->server_configuration' exists and contains valid data."}} {"log":{"token_hash":"5fa1faa595391","context":{"ip":"127.0.1.1","class":"TaskRunner\Executor","function":"update","line":409},"time":1604451864,"date":"2020-11-04T06:34:24+05:30","content":"--- (Worker 2639:vinayak:0) : Message not sent."}}

fatal_errors.txt


{"log":{"token_hash":"5fa1fe17a04a9","context":{"ip":"::1","class":"Bootstrap","function":"exceptionHandler","line":194},"time":1604451864,"date":"2020-11-04T06:34:24+05:30","content":"Message has been sent"}} {"log":{"token_hash":"5fa1fe17a04a9","context":{"ip":"::1","line":null},"time":1604451864,"date":"2020-11-04T06:34:24+05:30","content":{"error":"Failed to open the file.","trace":[{"file":"\/home\/matecat\/cattool\/lib\/Utils\/DefuseEncryption.php","line":21,"function":"createEncryptionKey","class":"DefuseEncryption","type":"->","args":[]},{"file":"\/home\/matecat\/cattool\/lib\/Utils\/OauthTokenEncryption.php","line":19,"function":"__construct","class":"DefuseEncryption","type":"->","args":["\/home\/matecat\/cattool\/inc\/oauth-token-key.txt"]},{"file":"\/home\/matecat\/cattool\/lib\/Model\/OAuthSignInModel.php","line":36,"function":"getInstance","class":"OauthTokenEncryption","type":"::","args":[]},{"file":"\/home\/matecat\/cattool\/lib\/Controller\/oauthResponseHandlerController.php","line":59,"function":"setAccessToken","class":"OAuthSignInModel","type":"->","args":[{"access_token":"","scope":"https:\/\/www.googleapis.com\/auth\/userinfo.email https:\/\/www.googleapis.com\/auth\/userinfo.profile openid https:\/\/www.googleapis.com\/auth\/drive https:\/\/www.googleapis.com\/auth\/drive.install","token_type":"Bearer","id_token":"}]},{"file":"\/home\/matecat\/cattool\/lib\/Controller\/oauthResponseHandlerController.php","line":35,"function":"_processSuccessfulOAuth","class":"oauthResponseHandlerController","type":"->","args":[]},{"file":"\/home\/matecat\/cattool\/index.php","line":12,"function":"doAction","class":"oauthResponseHandlerController","type":"->","args":[]}]}}}

vinayaksharmagh commented 3 years ago

By the way, I have followed the instructions given in INIT.php file to setup Google Oauth

vinayaksharmagh commented 3 years ago

I am also receiving an email from google saying "Matecat was granted access to your Google Account"

Ostico commented 3 years ago

Hi @vinayaksharmagh in your logs i see an exception in DefuseEncryption when it tries to save the generated private key on disk. Check that your web server has write permission on that file: /inc/oauth-token-key.txt

vinayaksharmagh commented 3 years ago

Hi @Ostico . Thanks for the response. I have taken a look at the /home/matecat/cattool/inc directory and there is no file named oauth-token-key.txt. Infact, only the following files are there in the inc directory.

config.ini config.ini.sample task_manager_config.ini task_manager_config.ini.sample oauth_config.ini oauth_config.ini.sample INIT.php Bootstrap.php dfq (directory) Error_Mail_List.ini.sample login_secret.dat phinx.php PHPTAL qamodel.json version.ini

Please refer to the screenshot for the permissions. (Ignore the backup files)

Screenshot (319)

Ostico commented 3 years ago

Hi @vinayaksharmagh in your logs i see an exception in DefuseEncryption when it tries to save the generated private key on disk. Check that your web server has write permission on that file: /inc/oauth-token-key.txt

Sorry wrong word, i rephrase: Check that your web server has write permission FOR that file: /inc/oauth-token-key.txt

vinayaksharmagh commented 3 years ago

Thanks! So, I created the file /home/matecat/cattool/inc/oauth-token-key.txt myself and then changed its permission to 777 and then performed chown -R matecat:matecat /home/matecat/cattool/* chown -R www-data /home/matecat/cattool/storage/

This removed the above issue and I can now log in using google account. Although, at the very first login (when oauth-token-key.txt is empty), it takes to a blank page and we need to perform the login steps again to get in.

Ostico commented 3 years ago

Great! Glad you solved your issue.

vinayaksharmagh commented 3 years ago

Great! Glad you solved your issue.

Thanks @Ostico Could not have done it without your help!