API problems after upgrade to Debian 12

Discussion in 'General' started by SamTzu, Oct 30, 2023.

  1. SamTzu

    SamTzu Active Member

    This used to work on Debian 11 / PHP 7 ...

    Code:
               
                $soap_location = 'https://server.domain.com:8080/remote/index.php';
                $soap_uri = 'https://server.domain.com:8080/remote/';
                $this->soapClient = new SoapClient(null, array('location' => $soap_location,
    
                    'uri' => $soap_uri));
                    //* Login to the remote server
                    if ($session_id = $this->soapClient->login($username, $password))
                    {
    //                   echo 'Logged into remote server sucessfully. The SessionID is ' . $session_id;
                    }
                    if($this->makeCall('mail_user_add', $session_id, 1, [
                        'server_id' => 1,
                        'email' => $email,
                        'login' => $email,
                        'password' => $pass,
                        'maildir' => '/var/vmail/' . $emailData[1] . '/' . $emailData[0],
                        'homedir' => '/var/vmail',
                        'name' => $this->user->name,
                        'quota' => 1073741824,
                        'move_junk' => 'y',
                        'custom_mailfilter' => 'spam',
                        'access' => 'y',
                        'postfix' => 'y',
                        'purge_trash_days' => 30,
                        'purge_junk_days' => 30,
                        'disableimap' => 'n',
                        'disablepop3' => 'n',
                        'disabledeliver' => 'n',
                        'disablesmtp' => 'n'
    
    But it does not work on Debian 12 / PHP 8.
    There is no error message. Code seeems fine but no new email account is created anymore.
     
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Anything in the ISPConfig logging?
     
  3. SamTzu

    SamTzu Active Member

    Other than complaining about namespace there's nothing. I fixed that by raising the Namespace one line up :) It was on line 3 and and only code after <?php. Now it's on line 2 and debug no longer gives any error message on PHP so I'm thinking the problem is on ISPconfig side but ISPconfig logs give no hint on what's going on.

    Code:
    mod_fcgid: stderr: PHP Fatal error:  Namespace declaration statement has to be the very first statement or after any declare call in the script
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    Please describe what you mean exactly with it does not work, is nothing inserted into the database (Please check mail_user table). or is nothing displayed in ISPConfig? Or is the mailbox displayed in ISPConfig, but does not work when you access it with a mail client?
     
  5. SamTzu

    SamTzu Active Member

    ispconfig.log has only 1 error message that might be related...
    Code:
    DEBUG [system.inc:2430] - safe_exec cmd: grep ^opcache.validate_root '/etc/php/8.2/fpm/php.ini' - return code: 0
     
  6. SamTzu

    SamTzu Active Member

    @till
    Hi till thx 4 help.
    The laravel script "app/Http/Livewire/Landing.php" used to work and after adding a new mail user with mail_user_add the script would transfer to Stripe to handle payment.
    Now the script goes trough like everyting is fine. I can see new user both in my DataBase that checks for double users and I can see the new user on Stripe panel but nothign on ISPConfig (panel or DB). There is no error message in any of the logs event though I have Debug on. It's like ISPConfig thinks that everything went trough fine so there is no need to complain.
     
    Last edited: Oct 31, 2023
  7. SamTzu

    SamTzu Active Member

    Christmas season is coming. I'm willing to pay for support (that fixes this.)
     
    ahrasis likes this.
  8. SamTzu

    SamTzu Active Member

    Fast help.
    Thx 2 Tim.
    Correct answer was...
    Remote User now requires "Mail user functions" enabled.
    It didn't use to.
     
  9. SamTzu

    SamTzu Active Member

    Would be nice if there was some kind of entries on ispconfig.log on what happens with API. Or maybe a new api.log file?
     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    This was always required. The code has not been changed in this regard.

    The API returns this as a SOAP error to your script. Maybe you do not have error handling in your script implemented to catch soap errors? When you take a look at the API examples, they always contain a try - catch statement to catch soap errors and to display them. But yes, we could add some kind of developer log to log errors that are returned to the app that uses the API.
     
    ahrasis likes this.

Share This Page