Bosco1983

Q: Postgres error - the operation can't be completed

Server 5, Profile Manager running like a dog.  Ive used the "Proxy timeout" Apache fix posted on these forums which helped for a while, but now (without changing anything) Profile Manager is back to crashing often.

 

If I type sudo serveradmin start postgres or serveradmin stop postgres, I get the below error message.

 

postgres:error = <62706c69 73743030 d4010203 04050618 19582476 65727369 6f6e5824 6f626a65 63747359 24617263 68697665 72542474 6f701200 0186a0a4 07081112 55246e75 6c6cd409 0a0b0c0d 0e0f1056 4e53436f 64655a4e 53557365 72496e66 6f584e53 446f6d61 696e5624 636c6173 73100180 00800280 035f1014 636f6d2e 6170706c 652e7365 72766572 6d677264 d2131415 165a2463 6c617373 6e616d65 5824636c 61737365 73574e53 4572726f 72a21517 584e534f 626a6563 745f100f 4e534b65 79656441 72636869 766572d1 1a1b5472 6f6f7480 0108111a 232d3237 3c424b52 5d666d6f 7173758c 919ca5ad b0b9cbce d3000000 00000001 01000000 00000000 1c000000 00000000 00000000 00000000 d5>

postgres:errorDescription = "The operation couldn’t be completed. (com.apple.servermgrd error 1.)"

postgres:errorCode = 1

 

Whats this mean, and when are apple going to fix the server.app?

Mac mini, OS X Server

Posted on Jan 12, 2016 1:16 AM

Close

Q: Postgres error - the operation can't be completed

  • All replies
  • Helpful answers

  • by mscott_mdm,

    mscott_mdm mscott_mdm Jan 12, 2016 11:47 AM in response to Bosco1983
    Level 2 (225 points)
    Jan 12, 2016 11:47 AM in response to Bosco1983

    Bosco1983, there probably is something logged in /Library/Logs/ProfileManager/servermgr_devicemgr.log when this happens. Can you paste that into this discussion?

  • by Bosco1983,

    Bosco1983 Bosco1983 Jan 13, 2016 3:14 AM in response to mscott_mdm
    Level 1 (61 points)
    Servers Enterprise
    Jan 13, 2016 3:14 AM in response to mscott_mdm

    Hello,

     

    here is the log at the time of the error message (which I can trigger with start / stop postgres command).

     

    thanks

     

    1:: [804] [2016/01/13 11:10:10.978] -[DeviceManagerRequestHandler getStateWithRequest:]: response:

         [1;32m———————+——————— [0m

        _id_ :  -

        state : RUNNING

         [1;32m———————+——————— [0m

    2:: [804] [2016/01/13 11:10:11.032] -[DeviceManagerRequestHandler _sendRequestToDevicemgrd:]: request:

         [1;32m—————————+———————————— [0m

        command : readSettings

         [1;32m—————————+———————————— [0m

    3:: [804] -[SocketRequest stream:handleEvent:]: Read 1899 total bytes this round

    2:: [804] [2016/01/13 11:10:11.042] -[DeviceManagerRequestHandler _sendRequestToDevicemgrd:]: result:

         [1;32m————————————————————+———— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ———————————————————— [0m

        PayloadDisplayName : Settings for Everyone

        PayloadEnabled :     0

        command :            readSettings

        configuration :       [1;32m————————————————————————⠀”———————+——————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”————————————————————————— [0m

                             CodeSigningAuthorityChain :      /etc/certificates/www.mmhs.info Code Signing Certificate.FBB98667BFE6FF27788BD7D54191595CECDAAE2A.chain.pem

                             CodeSigningCertificate :         /etc/certificates/www.mmhs.info Code Signing Certificate.FBB98667BFE6FF27788BD7D54191595CECDAAE2A.cert.pem

                             CodeSigningPersistentReference : <73737569 00000020 87191ca3 0fc911d4 849a0005 02b52122 00000000 00000000 00000000 00000006 64626e6d 00000023 2f4c6962 72617279 2f4b6579 63686169 6e732f53 79737465 6d2e6b65 79636861 696e0069 74656d00 0000bd80 00100000 00000401 00000000 0000a430 81a13127 30250603 5504030c 1e496e74 65726d65 64696174 6543415f 5757572e 4d4d4853 2e494e46 4f5f3131 21301f06 0355040a 0c184d61 74746865 77204d6f 73732048 69676820 5363686f 6f6c312d 302b0603 55040b0c 244d4143 4f535820 4f70656e 44697265 63746f72 7920496e 7465726d 65646961 74652043 41312430 2206092a 864886f7 0d010901 1615736c 616e6361 73746572 406d6d68 732e636f 2e756b00 00000500 99b26995>

                             CodeSigningPrivateKey :          /etc/certificates/www.mmhs.info Code Signing Certificate.FBB98667BFE6FF27788BD7D54191595CECDAAE2A.key.pem

                             apns_active :                    1

                             apns_topic :                     com.apple.mgmt.XServer.421d34f8-4a96-4fee-ae5a-c6e578501027

                             email_address :                  editedtoremovemyemail@thanks.com

                             enableCodeSigning :              0

                             od_active :                      1

                             od_master :                      127.0.0.1

                             serviceDataLocation :            /Library/Server/ProfileManager

                             service_enabled :                1

                             ssl_active :                     1

                              [1;32m————————————————————————⠀”———————+——————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”————————————————————————— [0m

        result :             ok

        settings :            [1;32m————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”—————————————————————————— [0m

         [1;32m————————————————————+———— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ——————————————————————————†”——————————————————————————⠀”—————————————————————————— ———————————————————— [0m

    2:: [804] [2016/01/13 11:10:11.044] -[DeviceManagerRequestHandler _sendRequestToDevicemgrd:]: request:

         [1;32m—————————+——————————————— ———————————— [0m

        command : readAppDistributionSettings

         [1;32m—————————+——————————————— ———————————— [0m

    3:: [804] -[SocketRequest stream:handleEvent:]: Read 506 total bytes this round

    2:: [804] [2016/01/13 11:10:11.047] -[DeviceManagerRequestHandler _sendRequestToDevicemgrd:]: result:

         [1;32m———————————————+————————— ——————————————————————————†”— [0m

        configuration :  [1;32m—————————+——————————————— ———————————— [0m

                        appleID : editedtoremovemyemail@thanks.com

                        expDate : 2016-03-08T03:28:37-0800

                        orgName : External Company

                         [1;32m—————————+——————————————— ———————————— [0m

        result :        ok

        state :         ENABLED

         [1;32m———————————————+————————— ——————————————————————————†”— [0m

    2:: [804] [2016/01/13 11:10:11.049] -[DeviceManagerRequestHandler _sendRequestToDevicemgrd:]: request:

         [1;32m—————————+——————————————— ——————————————————————— [0m

        command : readSimplifiedDeviceEnrollmentSettings

         [1;32m—————————+——————————————— ——————————————————————— [0m

    3:: [804] -[SocketRequest stream:handleEvent:]: Read 274 total bytes this round

    2:: [804] [2016/01/13 11:10:11.053] -[DeviceManagerRequestHandler _sendRequestToDevicemgrd:]: result:

         [1;32m————————+———————— [0m

        result : ok

        state :  DISABLED

         [1;32m————————+———————— [0m

  • by macwestly77,

    macwestly77 macwestly77 Jan 15, 2016 8:44 AM in response to mscott_mdm
    Level 1 (5 points)
    Jan 15, 2016 8:44 AM in response to mscott_mdm

    mscott_mdm  Sorry to hijack this thread but I am hoping you can help me with a profile manager (server 5.x) migration error.  Is there a way to contact you directly?

  • by essandess,Helpful

    essandess essandess Jan 19, 2016 1:00 AM in response to Bosco1983
    Level 1 (28 points)
    Applications
    Jan 19, 2016 1:00 AM in response to Bosco1983

    sudo serveradmin start postgres

    ...

    postgres:errorDescription = "The operation couldn’t be completed. (com.apple.servermgrd error 1.)"

     

    Local postgres management is no longer supported through the serveradmin command. You'll get the same error for any unsupported service (try "sudo serveradmin start osxserver_should_really_support_a_local_postgres_service").

     

    You have two options:

     

    1. Adapt Server.app's existing postgres infrastructure to run your own local postgres service.
    2. Install and manage your own postgres server through macports or homebrew.

     

    I prefer Option 1 because Server.app depends on postgres for other Server services and will rely on Apple to upgrade PostgreSQL, rather than adding an extra independent service I have to remember to maintain and manage. If Apple ever irretrievably breaks postgres in Server.app, it's just postgres, so Option 2 is always on the table.

     

    To adapt Server.app's existing postgres infrastructure, you just need to configure your own local PostgreSQL instance (which probably already exists in /Library/Server/PostgreSQL), add a launch daemon for Server.app's postgres binary that uses this configuration, and make sure you have regular backups of both the configuration and the database.

     

    Do these steps:

     

    # copy PostgreSQL configuration

    sudo rsync -va /path/to/old/PostgreSQL/ /Library/Server/PostgreSQL

     

    # ensure that pg_hba.conf is configured as you want. Here's a permissive example.

     

    cat /Library/Server/PostgreSQL/Data/pg_hba.conf

    ...

    # TYPE  DATABASE        USER            ADDRESS                 METHOD

    # "local" is for Unix domain socket connections only

    local   all             all                                     trust

    # IPv4 local connections:

    host    all             all             127.0.0.1/32            trust

    # IPv6 local connections:

    host    all             all             ::1/128                 trust

    # Allow replication connections from localhost, by a user with the

    # replication privilege.

    #local   replication     _postgres                                trust

    #host    replication     _postgres        127.0.0.1/32            trust

    #host    replication     _postgres        ::1/128                 trust

    # Admin added dbs

    host    snort           snort           127.0.0.1/32            password

     

    Don't confuse these next two plist files, which have the same name but live in different directories.

     

    # postgres configuration plist org.postgresql.postgres.plist

    # postgres configuration plist

    sudo cp org.postgresql.postgres.plist /Library/Server/PostgreSQL/Config/

     

    org.postgresql.postgres.plist (postgres configuration plist)

    <?xml version="1.0" encoding="UTF-8"?>

    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

    <plist version="1.0">

    <dict>

      <key>ProgramArguments</key>

      <array>

      <string>-D</string>

      <string>/Library/Server/PostgreSQL/Data</string>

      <string>-c</string>

      <string>listen_addresses=127.0.0.1,::1</string>

      <string>-c</string>

      <string>log_connections=on</string>

      <string>-c</string>

      <string>log_directory=/Library/Logs/PostgreSQL</string>

      <string>-c</string>

      <string>log_filename=PostgreSQL.log</string>

      <string>-c</string>

      <string>log_line_prefix=%t </string>

      <string>-c</string>

      <string>log_lock_waits=on</string>

      <string>-c</string>

      <string>log_statement=ddl</string>

      <string>-c</string>

      <string>logging_collector=on</string>

      <string>-c</string>

      <string>unix_socket_directories=/private/var/pgsql_socket</string>

      <string>-c</string>

      <string>unix_socket_group=_postgres</string>

      <string>-c</string>

      <string>unix_socket_permissions=0770</string>

      </array>

    </dict>

    </plist>

    # launch daemon org.postgresql.postgres.plist

    sudo cp org.postgresql.postgres.plist /Library/LaunchDaemons

    sudo launchctl load -w /Library/LaunchDaemons/org.postgresql.postgres.plist

     

    org.postgresql.postgres.plist (launch daemon)

    <?xml version="1.0" encoding="UTF-8"?>

    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

    <plist version="1.0">

    <dict>

      <key>Label</key>

      <string>org.postgresql.postgres</string>

      <key>UserName</key>

      <string>_postgres</string>

      <key>GroupName</key>

      <string>_postgres</string>

      <key>ProgramArguments</key>

      <array>

      <string>/Applications/Server.app/Contents/ServerRoot/usr/bin/postgres</string>

      <string>--apple-configuration</string>

      <string>/Library/Server/PostgreSQL/Config/org.postgresql.postgres.plist</string >

      </array>

      <key>KeepAlive</key>

      <dict>

      <key>PathState</key>

      <dict>

      <key>/Library/Server/PostgreSQL/Data</key>

      <true/>

      </dict>

      </dict>

      <key>StandardErrorPath</key>

      <string>/Library/Logs/PostgreSQL/PostgreSQL.log</string>

      <key>StandardOutPath</key>

      <string>/Library/Logs/PostgreSQL/PostgreSQL.log</string>

    </dict>

    </plist>

     

    Finally, see this thread for how to independently backup Server.app and OD data. The specific postgres commands are:

     

    # Backup database

    sudo sh -c '/Applications/Server.app/Contents/ServerRoot/usr/bin/pg_dumpall -U _postgres | bzip2 -c > /private/var/backups/postgres.dumpall.bz2'

     

    # Restore database

    sudo bzcat /private/var/backups/postgres.dumpall.bz2 | sudo /Applications/Server.app/Contents/ServerRoot/usr/bin/psql -q -d postgres _postgres --password

  • by Bosco1983,

    Bosco1983 Bosco1983 Jan 19, 2016 1:01 AM in response to essandess
    Level 1 (61 points)
    Servers Enterprise
    Jan 19, 2016 1:01 AM in response to essandess

    Many thanks for this, really appreciate your time.

     

    So the error message I am receiving is actually quite normal?  Am I safe to just ignore it and continue working as normal?  Or do I NEED to go through your steps above in order to fix problems?

     

    thanks again.