Menu

Ajax Communication Error

Help
afla0808
2018-02-14
2022-05-22
  • afla0808

    afla0808 - 2018-02-14

    Hi, first time user on the forums.
    I have tried to install RADIUSDESK on a local ubuntu machine, after following the instructions, I received an error after entering in the default credentials at the login page:
    "Failure
    Ajax communication failed"

    I decided instead of troubleshooting, I would start with a fresh ubuntu installation and follow the instructions to a tee. https://www.radiusdesk.com/docuwiki/getting_started/install_ubuntu_nginx
    I followed to a tee and I still receive the Ajax Communication Error.

    When I inspect the network using firefox I see this:
    Request URL: http://127.0.0.1/cake3/rd_cake/dashboard/authenticate.json
    Request method: POST
    Remote address: 127.0.0.1:80
    Status code: 502 Bad Gateway
    Version: HTTP/1.1.

    If I have re-made a previously answered thread, my appologies. But I have been doing searches trying to find an answer, and nothing. I really hope someone on here can help me work through this issue. And it seems like such a little issue to have me give up on using it.

    Thanks in advance for anything from an answer to a push in the right direction!

     
    • TEDD

      TEDD - 2019-06-10

      @afla0808
      I am facing the same problem. Actually I have another system installed but not working well.
      At least on the other system I can login

      Working system I have no output errors from the following link
      http://127.0.0.1/cake3/rd_cake/dashboard/authenticate.json

      The system with Ajax communication failed , the output of the same command is "404 Not Found"

      I have no clue of where the problem is.

      If you were able to solve your problem, please let me know.

       
  • maulinho13

    maulinho13 - 2018-08-15

    I have the same error... I installed RadiusDesk with different username, password, and database name than the default. I changed document root for Nginx too. Other than that, everything was installed just like the instructions. Everything was fine, nginx running, mysql running, freeradius running, nodejs running... but I can't login with root:admin, always says "Failure, Ajax communication failed". Anyone pls help... What should I adjust?

     

    Last edit: maulinho13 2018-08-15
  • maulinho13

    maulinho13 - 2018-08-15

    Solved it... need to adjust setting in /var/www/html/cake3/rd_cake/config/app.php, profile Datasources. Also adjust /var/www/html/cake2/rd_cake/Config/database.php, class DATABASE_CONFIG, array $default. I guess since RD uses both CakePHP 2 & 3, u need to adjust both. Adjust document root path above if u'r not using /var/www/html/.

     
  • Carsten Dittich

    Carsten Dittich - 2018-09-14

    Hi,
    (sorry for bad english) i'm a newbee in linux but i've to install the radiusdesk. with many testing and trying and crying (...) radiusdesk is on my engine (Ubuntu 16_4LTS).
    But, i have the same problem with the login - ajax communication failed.

    then i have read the file app.php and database.php and i think there is all ok (username, password, database). Which settings do you mean?

    Many thx,
    Carsten

     
    • maulinho13

      maulinho13 - 2019-05-03

      Ookaay, setting 2nd server for another use, somehow I got this error again (^^;)

      Adjusted setting in:
      1. /path/to/radiusdesk/cake2/rd_cake/Setup/Node.js/Logfile.node.js
      2. /path/to/radiusdesk/cake2/rd_cake/Setup/Node.js/nodejs-socket-io
      3. /path/to/radiusdesk/cake2/rd_cake/Setup/Node.js/nodejs-socket-io.service
      to change default values for database name, user, password, document root to radiusdesk.

      Enabling and starting nodejs-socket-io.service runs fine, but then I can't log in and got 'Ajax communication failure' again. Try stopping nodejs-socket-io.service, restart nginx, and try again. For some reason its messing with radiusdesk. I dunno what's nodejs required for tho, but it's there in the install manual, so... I honestly don't know what's the issue. Need to delve into it again. Restart webserver, database server, and fire it up again.

       

      Last edit: maulinho13 2019-05-05
  • Kennedy Kioko

    Kennedy Kioko - 2020-03-09

    I Have the same issue and noe of the solutions are working

     
  • Dion Garcia

    Dion Garcia - 2020-05-17

    Hi I encountered the same error too during login after installation. After a quick inspection I get the following:

    status response: 500 from authenticate.json
    message: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'groups Groups ON Groups.id = (Users.group_id) WHERE Users.id = 44 LIMIT 1' at line 1

    After further investigation it seems that 'groups' is already a reserve word in mysql 8 and therefore any sql statements that contains the word 'groups' without backticks would fail. By the way my build is Ubuntu 20.04 64-bit on raspberry pi and im using mysql 8 because its the bundled mysql package. I'm still looking for ways to be able to install a lower version preferrably 5.7 but so far im unable to get arm64 support. If anybody have an idea how to solve this please let me know.

    Another option would be to update the sql statements but I don't know where to start. Some tips where to start would be highly appreciated.

    Thanks and regards.

     
  • Dirk van der Walt

    Hi Dion,

    I see other people also reported this happening on their CakePHP based applications and MySQL 8

    https://github.com/passbolt/passbolt_api/issues/325

    See if this tip works for you and let us know.

    I still need to get round to complete and test the instructions on Ubunti 20.04...

    Kind regards

     
    • Dion Garcia

      Dion Garcia - 2020-05-17

      Hi Dirk,

      Big thanks for the tip. My setup seems to be working now and I'm able to login. For others who encounter the same issue as mine just edit WWW_ROOT/html/cake3/rd_cake/config/app.php and set 'quoteIdentifiers' to true.

               /**
               * Set identifier quoting to true if you are using reserved words or
               * special characters in your table or column names. Enabling this
               * setting will result in queries built using the Query Builder having
               * identifiers quoted when creating SQL. It should be noted that this
               * decreases performance because each query needs to be traversed and
               * manipulated before being executed.
               */
              'quoteIdentifiers' => true,
      

      Thanks and regards.

       

      Last edit: Dion Garcia 2020-05-17
  • AJ

    AJ - 2020-05-20

    Hi, I'm getting same error while setting up the Radiusddesk in WSL. Can someone please suggest a solution?

     
    • Dion Garcia

      Dion Garcia - 2020-05-20

      Hi Albin,

      Please check your /WWW_ROOT/cake3/rd_cake/logs/error.log for error details. I think this is just a generic error message so a more informative detail would be great. Then maybe somebody will be able to help.

      Cheers.

       
  • AJ

    AJ - 2020-05-21

    Hi Dion Garcia,

    Firstly thanks for your quick response.
    I checked error.log file details and found that the logs are not getting added to the file. The existing logs shows the dates of 2017(But I installed it 3-4 days back only). The main highlight is I'm trying this on windows server WSL. Kindly see the attached log file.
    I doubt since it's in WSL, there may be some path(root) mismatch. Do you have any suggestions?
    Thanks for your support in advance.

     
    • Dion Garcia

      Dion Garcia - 2020-05-21

      Hi Albin,

      Its possible that you have some path issues. Please double check on your setup. Take note that the online docs and source codes uses /usr/share/nginx/html as web root. Please check if your setup is the same. In my case the default path is /var/www/html so i have to adjust my setup. Please check the following config files under "cake3/rd_cake/config:

      • app.ph
      • bootstrap.ph
      • RadiusDesk.php
      • paths.php

      Also change the paths in /etc/cron.d/rd if you are using a differnt web root.

      You may also debug the issue using the developer options in your browser. Its available in most browsers i guess. Its available in chrome and firefox.

       
  • AJ

    AJ - 2020-06-17

    Hi Dion,

    Thanks for the support..
    I've cleared this issue by changing the version of 'cake'. I tried with latest version and hen I downgrade it it started working.
    (sorry for the delay in response)

     
  • Arjun

    Arjun - 2022-04-28

    Urgh Guys really now. Now I am so confused I don't know which way to go on this. Getting the same issue here. What Dion is saying up here makes sense but I cant quite figure out what he is saying, and AJ could you confirm that downgrading cake fixed this for you? Also how did you do this? I'm a networking guy, with quite some Linux experience but honestly this is the first time I ran into cake, and all I can find for downgrading cake has something to do with docker and doesnt seem relevant to what is going on here.

     
  • Arjun

    Arjun - 2022-04-28

    Dirk kan jy nie dalk bietjie woord by sit hier nie bra ek's nou moer deurmekaar.

     
    • Dirk van der Walt

      Dan moet ons jou help dat jou install kan werk :-)

      Did you follow these instructions here:
      http://radiusdesk.com/docuwiki/getting_started/20_install_ubuntu_nginx

      That is the latest instructions. Also these are still for 20.04 since I have not got round to add / test on 22.04 yet.

       
      • tkoech

        tkoech - 2022-05-22

        I've followed the latest instructions to the "T" on Ubuntu 20.04 and I'm still getting the same "Ajax communication failed" error when trying to login to the dashboard.

        http://radiusdesk.com/docuwiki/getting_started/20_install_ubuntu_nginx

        What causes it? Are there any error logs that can be inspected? How can I fix it?

        Thanks

         
  • Arjun

    Arjun - 2022-04-29

    ok cool ek maak so maater. Moer cool om met n Afrikaner te gesels oor n stuk sagterware uit Suid Afrika. Noggals om die draai van my tuisdorp. ;)

     
  • Arjun

    Arjun - 2022-04-29

    Ok Bra so ek moet nou net laat weet die een was my skuld, ek het die verkeerde lyntjie geuncomment.

    pass PHP scripts to FastCGI server

    location ~ .php$ {
    include snippets/fastcgi-php.conf;
    #
    # # With php-fpm (or other unix sockets):
    #fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    # # With php-cgi (or other tcp sockets):
    fastcgi_pass 127.0.0.1:9000;
    }
    inplaas van

    pass PHP scripts to FastCGI server

    location ~ .php$ {
    include snippets/fastcgi-php.conf;
    #
    # # With php-fpm (or other unix sockets):
    fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;
    # # With php-cgi (or other tcp sockets):
    # fastcgi_pass 127.0.0.1:9000;
    }

     
  • Arjun

    Arjun - 2022-04-29

    For the international community this was my fault, I uncommented the wrong line, in the snippet above. Sorry guys.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.