The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

API listaccts not returning any results

Discussion in 'cPanel Developers' started by herbmanafet, Feb 5, 2015.

  1. herbmanafet

    herbmanafet Registered

    Joined:
    Feb 5, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    WHM 11.48.0

    Running API V1 listaccts on this particular server returns no results most of the time.

    It seems that adding a new account, or running the script /scripts/updateuserdomains will sometimes cause listaccts to work, but only once. Subsequent calls return nothing.

    I'm also experiencing this on some of our other servers, while others work flawlessly every time.

    Has anyone experienced this?
     
  2. herbmanafet

    herbmanafet Registered

    Joined:
    Feb 5, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Update: Deleting an account also causes the next try of listaccts to work, but only once.

    I'm testing this with my local version of xmlapi as well as with the WHM API Shell.
     
  3. herbmanafet

    herbmanafet Registered

    Joined:
    Feb 5, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I should add that there is no error, and the call is returning data, but the accounts are not listed. Here's the response I get:

    {"metadata":{"version":1,"reason":"OK","result":1,"command":"listaccts"}}

    As you can see, there are no accounts, but it's saying everything is good.
     
  4. cPJacob

    cPJacob cPanel Product Owner
    Staff Member

    Joined:
    May 2, 2014
    Messages:
    510
    Likes Received:
    66
    Trophy Points:
    28
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    Hi,

    I'm unable to replicate this. On my personal server (11.48.0.9), the listaccts API call is working for me both within API shell and CLI xml-api after running them multiple times.

    When you run this command, are there any logs in /usr/local/cpanel/logs/error_log?

    If not, I'd recommend opening a support ticket using the information in my signature.
     
  5. herbmanafet

    herbmanafet Registered

    Joined:
    Feb 5, 2015
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi Jacob,

    Actually, I'm seeing the followin log entries whenever the script runs:

    Code:
    [2015-02-09 08:35:10 +1000] info [xml-api] Invalid legacy backup directory "/": Invalid value for BACKUPDIR.
    [2015-02-09 08:36:34 +1000] info [xml-api] Invalid legacy backup directory "/": Invalid value for BACKUPDIR.
    [2015-02-09 08:40:10 +1000] info [xml-api] Invalid legacy backup directory "/": Invalid value for BACKUPDIR.
    [2015-02-09 08:45:08 +1000] info [xml-api] Invalid legacy backup directory "/": Invalid value for BACKUPDIR.
    Not sure if this is related to listaccts though. Also, when I checked, Legacy Backup is disabled on this server?

    Any ideas?

    Thanks,
    Scott.
     
    #5 herbmanafet, Feb 8, 2015
    Last edited by a moderator: Feb 9, 2015
  6. Mesutbilgili

    Mesutbilgili Registered

    Joined:
    May 17, 2011
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hello,

    I found the solution. In whm panel open "Backup Configuration" and in "Backup Accounts" section push "Select Users" button. Than "Disable All Legacy" I atttached image. Than you can list accounts.

    legacy.jpg
     
Loading...

Share This Page