Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Oct 2006
    Posts
    6

    Default addftp API2 call failing - "Failed to determine FTP account xxxx directory"

    My call to the addftp xmlapi just failed and I can't figure out why:

    It has been working up until today.

    Here's the result dump (from php). "USERNAME" is substituted for the user name we were trying to assign a ftp account to. I've tried a couple different usernames/passwords, same results.
    Code:
    Array
    (
        [cpanelresult] => Array
            (
                [data] => Array
                    (
                        [0] => Array
                            (
                                [result] => 0
                                [reason] => Failed to determine FTP account USERNAME directory.
                            )
    
                    )
    
                [event] => Array
                    (
                        [result] => 1
                    )
    
                [module] => Ftp
                [apiversion] => 2
                [func] => addftp
            )
    )
    If I look in the directory where it's attempting to create the user folder, it appears to have succeeded. The user folder is there and set 0755

    The user names and passwords I'm passing are also valid choices.

    WHM 11.28.87
    CENTOS 5.5 i686 standard

    ????

  2. #2
    Integration Developer cPanelDavidN's Avatar
    Join Date
    Dec 2009
    Location
    Houston, TX
    Posts
    525

    Default Re: addftp API2 call failing - "Failed to determine FTP account xxxx directory"

    Hi filmoftheklown,

    Can you place post a copy of either a snippet of PHP script (in which you are making you XML-API query) or the query URL with the parameters. It's like that there's some parameter keys that aren't being properly interpreted by the XML-API binary.

    (if you're using our XML-API PHP client class, you can retrieve that URL from the PHP error_log with you enable debugging, ie. $xmlapi->set_debug(1))

    Regards,
    -DavidN
    David Neimeyer
    Integration Developer

    sdk.cpanel.net
    APIs: XML-API API1 & API2
    Check Out: Developer Downloads Integration Blog
    Need Support? Support Ticket Developer Forum Feature Request

  3. #3
    Member
    Join Date
    Oct 2006
    Posts
    6

    Default Re: addftp API2 call failing - "Failed to determine FTP account xxxx directory"

    Figured it out. cPanel API doesn't like it when you pass it a login in WordCase. Only seems to work in lowercase. Fixed the problem by using:

    $login = strtolower($login);

    Before executing the XMLAPI call.

    Didn't try entirely UPPERCASE login, but definitely did not like WordCase logins.

    PS: I had prior assumed that login could be either mixed case or uppercase as a valid parameter.

  4. #4
    Registered User
    Join Date
    Apr 2011
    Posts
    3

    Default Re: addftp API2 call failing - "Failed to determine FTP account xxxx directory"

    I'm having the same problem it looks like it wants to create an annonymous account also... what the hell ?

  5. #5
    Integration Developer cPanelDavidN's Avatar
    Join Date
    Dec 2009
    Location
    Houston, TX
    Posts
    525

    Default Re: addftp API2 call failing - "Failed to determine FTP account xxxx directory"

    I haven't tested the uppercase/mixedcase scenario, but it makes sense to me that all characters should be lowercase.

    Other points to consider when using API2 Ftp::addftp:

    1) If you're making the call remotely via the XML-API, make sure you're using a version of the PHP XML-API class that is version 1.0.6 or higher (if you're coding in PHP and wish to use this class), or at least make sure you observe the need to differentiate the URL parameters for the function versus the XML-API parser (essentially, use 'cpanel_xmlapi_user' or 'cpanel_jsonapi_user' to itemize the cPanel user account and 'user' to describe the new FTP account name [otherwise two key-pair values with the same key in the URL will get munged when processed by the XML-API parser])

    2) Ensure that the 'user' parameter for the Ftp::addftp function is simply the unique portion of the FTP login. i.e. if your domain is dave.com and you intend to FTP into you account using 'webdeveloper@dave.com' you should set the 'user' value to 'webdeveloper'...no @$domain

    3) API2 Ftp::addftp does not allow for periods (the "dot" character) in the 'user' value. If you need such a FTP username, for example 'web.developer', use the API1 equivalent which allows for that sort of fine-grained' validation.

    -DavidN
    David Neimeyer
    Integration Developer

    sdk.cpanel.net
    APIs: XML-API API1 & API2
    Check Out: Developer Downloads Integration Blog
    Need Support? Support Ticket Developer Forum Feature Request

Similar Threads & Tags
Similar threads

  1. Replies: 2
    Last Post: 06-10-2011, 12:41 PM
  2. Ftp::addftp keeps failing
    By jrianto in forum cPanel Developers
    Replies: 1
    Last Post: 06-11-2009, 06:33 PM
  3. WHM error: "Cannot determine old ip address"
    By wsenter in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 10-20-2006, 08:51 AM
  4. Replies: 4
    Last Post: 03-25-2005, 03:02 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube