10 Replies Latest reply: Dec 21, 2013 7:52 AM by amidknight
amidknight Level 1 Level 1 (10 points)



I really don't be seeming to have much luck with this migration - but this is my primary concern.


I've been using a wiki with Server 2 for the past year or so. When I updated it went to pot and I've been receiving the attached error each time.


I did the initial install without much in the way of preparatory work - hoping the "just works" model of things. When that didn't work, I reverted to a Time Capsule backup from the last known valid state - everything worked famously. So, I figured I would give it a shot again - verifying disk permissions and disk first - then shutting down the server (but not individual services) - then installing OS X 10.9 - verifying again - then installing Server 3 - then turning the wiki service back on...same erorr (see attached - call stack first).


I've seen a similar problem on the forum; however, that issue was, purportedly, due to timezone issues based on the full trace, which is different than the one below.


Any thoughts/help on this would be greatly appreciated.





" [PGCQueryError] executing route /app-context/wiki/:


0 CoreFoundation 0x00007fff85c9941c __exceptionPreprocess + 172

1 libobjc.A.dylib 0x00007fff87b02e75 objc_exception_throw + 43

2 PostgreSQLClient 0x0000000104a551fe -[PGCConnection checkResultOK:forSQL:] + 697

3 PostgreSQLClient 0x0000000104a555b9 -[PGCConnection executeQuery:withParams:] + 950

4 PostgreSQLClient 0x0000000104a557d5 -[PGCConnection executeQuery:withParams:inBlock:] + 92

5 PostgreSQLClient 0x0000000104a559e2 -[PGCConnection executeSavedQuery:inBlock:] + 151

6 CSService 0x0000000104b23fe8 -[CSContentService entityForGUID:withInternalTags:] + 829

7 CSService 0x0000000104b25f68 __44-[CSContentService userEntityForExternalID:]_block_invoke + 267

8 PostgreSQLClient 0x0000000104a54941 -[PGCConnection transactionInBlock:onError:] + 150

9 CSService 0x0000000104b25e1e -[CSContentService userEntityForExternalID:] + 155

10 CSService 0x0000000104b86ce1 __39-[CSAuthService unauthenticatedSession]_block_invoke + 66

11 CSService 0x0000000104afa574 -[CSServiceBase disableRefObjsInBlock:] + 314

12 CSService 0x0000000104b86b8e -[CSAuthService unauthenticatedSession] + 215

13 CSService 0x0000000104b870e3 -[CSAuthService currentOrNewSession] + 154

14 CSService 0x0000000104b77311 +[CSHTTPRouteHelper setCurrentSessionForRequest:] + 264

15 CSService 0x0000000104b8cd0a __27-[CSAppContextService init]_block_invoke238 + 107

16 CSService 0x0000000104b72e6a __53-[CSRoutingHTTPConnection httpResponseForMethod:URI:]_block_invoke + 95

17 CSService 0x0000000104b7640b -[CSHTTPBackgroundResponse bounce:] + 286

18 Foundation 0x00007fff8e06e70b __NSThread__main__ + 1318

19 libsystem_pthread.dylib 0x00007fff8606a899 _pthread_body + 138

20 libsystem_pthread.dylib 0x00007fff8606a72a _pthread_struct_init + 0

21 libsystem_pthread.dylib 0x00007fff8606efc9 thread_start + 13



Caught exception "Error executing query [SELECT "_inner_entity"."isDeleted", "_inner_entity"."longName", "_inner_entity"."isBlogEnabled", "_inner_entity"."description", "_inner_entity"."containerGUID", "_inner_entity"."createTime", "_inner_entity"."updatedByUserGUID", "_inner_entity"."revision", "_inner_entity"."shortName", "_inner_entity"."themeInfo", "_inner_entity"."ownerGUID", "_inner_entity"."ownerType", "_inner_entity"."type", "_inner_entity"."createdByUserGUID", "_inner_entity"."isHidden", "_inner_entity"."guid", "_inner_entity"."blogGUID", "_inner_entity"."tinyID", "_inner_entity"."parentGUIDs", "_inner_entity"."updateTime", "_inner_entity"."avatarGUID", "_inner_entity"."isPermanentlyDeleted", "_inner_entity"."isAuthenticated", "_inner_entity"."login", "_inner_entity"."externalID", "_inner_entity"."activityTime", "_inner_entity"."detailPageGUID", "_inner_entity"."tags", "_inner_entity"."extendedAttributes", "_inner_entity"."privateAttributes", "_inner_entity"."isFavorite", "_inner_entity"."isMyPage", "_inner_entity"."isWatched", ("_inner_entity"."_activity").action_time AS "lastActivityTime", ("_inner_entity"."_activity").user_uid_fk AS "lastActivityUserGUID", "_inner_entity"."tags" AS "tags" FROM (SELECT entity.is_deleted AS "isDeleted", entity.long_name AS "longName", entity.is_blog_enabled AS "isBlogEnabled", entity.description AS "description", entity.container_uid_fk AS "containerGUID", entity.create_time AS "createTime", entity.updatedby_user_fk AS "updatedByUserGUID", entity.revision AS "revision", entity.short_name AS "shortName", entity.theme_info AS "themeInfo", entity.ownedby_uid_fk AS "ownerGUID", entity.owner_entity_type_fk AS "ownerType", entity.entity_type_fk AS "type", entity.createdby_user_fk AS "createdByUserGUID", entity.is_hidden AS "isHidden", entity.uid AS "guid", entity.blog_uid_fk AS "blogGUID", entity.tiny_id AS "tinyID", entity.parent_uids AS "parentGUIDs", entity.update_time AS "updateTime", entity.avatar_uid_fk AS "avatarGUID", entity.is_perm_deleted AS "isPermanentlyDeleted", user_entity.is_authenticated AS "isAuthenticated", user_entity.login AS "login", user_entity.external_id AS "externalID", user_entity.activity_time AS "activityTime", user_entity.detail_page_fk AS "detailPageGUID", coalesce(entity_tag.tags,'{}') AS "tags", entity_attrs.attrs_bin AS "extendedAttributes", entity_private_attrs.attrs_bin AS "privateAttributes", NULL AS "isFavorite", NULL AS "isMyPage", NULL AS "isWatched",   (SELECT DISTINCT ON (user_uid_fk, action_time) ROW(user_uid_fk, action_time)::last_activity      FROM user_activity     WHERE user_uid_fk=entity.uid  ORDER BY user_uid_fk, action_time DESC     LIMIT 1) AS "_activity" FROM entity LEFT OUTER JOIN user_entity ON (user_entity.entity_uid_fk=entity.uid) LEFT OUTER JOIN visible_entity_tag entity_tag ON (entity_tag.entity_uid_fk=entity.uid) LEFT OUTER JOIN entity_attrs ON (entity_attrs.entity_uid_fk=entity.uid) LEFT OUTER JOIN entity_private_attrs ON (entity_private_attrs.entity_uid_fk=entity.uid) WHERE entity.uid=$1  AND true = (    WITH acls AS (      SELECT entity_uid_fk, array_agg(external_id) AS external_ids        FROM entity_acls       WHERE entity_uid_fk=ANY(entity.parent_uids::uuid[])         AND 'read' <= action    GROUP BY entity_uid_fk      HAVING array_length(array_agg(external_id), 1) > 0    ORDER BY position(entity_uid_fk::text in array_to_string(entity.parent_uids, ',')) DESC       LIMIT 1    )    SELECT true      FROM acls     WHERE external_ids && $2     LIMIT 1) AND NOT entity.is_perm_deleted ) "_inner_entity"]: ERROR:  relation "visible_entity_tag" does not exist

LINE 1: ..._entity.entity_uid_fk=entity.uid) LEFT OUTER JOIN visible_en...


Mac mini, OS X Mavericks (10.9)
  • 1. Re: Wiki SQL error: Server 2 to 3 migration
    chaiyuttochai Level 1 Level 1 (0 points)

    i also have the same problem....
    but its may differance in detail
    I think Apple Server Software still have BUG with progrest DB
    why they didn't recheck it before publishing .... feel so upset

  • 2. Re: Wiki SQL error: Server 2 to 3 migration
    Miggl Level 1 Level 1 (75 points)

    I have a similar issue as well: https://discussions.apple.com/thread/5487713

    I'm hoping someone has figured out how to resolve this without loosing all data -- if migrating or recovering from a Time Machine backup doesn't work, and a complete fresh install is required, I'm not sure what I'm going to do.

  • 3. Re: Wiki SQL error: Server 2 to 3 migration
    amidknight Level 1 Level 1 (10 points)

    I have a call in to get assistance with the issue; however, tried fresh updates in preparation and receiving new error now when trying to connect to my Wiki:


    Caught exception "Error executing query [SELECT uid, user_uid_fk, auth_token, create_time, update_time, expire_time, data FROM session WHERE uid=$1]: ERROR:  column "expire_time" does not exist

    LINE 1: ...ser_uid_fk, auth_token, create_time, update_time, expire_tim...


    " [PGCQueryError] executing route /app-context/wiki/:


    0   CoreFoundation                      0x00007fff8e45741c __exceptionPreprocess + 172

    1   libobjc.A.dylib                     0x00007fff8dfabe75 objc_exception_throw + 43

    2   PostgreSQLClient                    0x000000010a4a91fe -[PGCConnection checkResultOK:forSQL:] + 697

    3   PostgreSQLClient                    0x000000010a4a95b9 -[PGCConnection executeQuery:withParams:] + 950

    4   PostgreSQLClient                    0x000000010a4a97d5 -[PGCConnection executeQuery:withParams:inBlock:] + 92

    5   CSService                           0x000000010a5d7ae9 __40-[CSAuthService _sessionForField:value:]_block_invoke + 255

    6   PostgreSQLClient                    0x000000010a4a8941 -[PGCConnection transactionInBlock:onError:] + 150

    7   CSService                           0x000000010a5d7993 -[CSAuthService _sessionForField:value:] + 208

    8   CSService                           0x000000010a5c929f +[CSHTTPRouteHelper setCurrentSessionForRequest:] + 150

    9   CSService                           0x000000010a5ded0a __27-[CSAppContextService init]_block_invoke238 + 107

    10  CSService                           0x000000010a5c4e6a __53-[CSRoutingHTTPConnection httpResponseForMethod:URI:]_block_invoke + 95

    11  CSService                           0x000000010a5c840b -[CSHTTPBackgroundResponse bounce:] + 286

    12  Foundation                          0x00007fff8dab970b __NSThread__main__ + 1318

    13  libsystem_pthread.dylib             0x00007fff83db4899 _pthread_body + 138

    14  libsystem_pthread.dylib             0x00007fff83db472a _pthread_struct_init + 0

    15  libsystem_pthread.dylib             0x00007fff83db8fc9 thread_start + 13


  • 4. Re: Wiki SQL error: Server 2 to 3 migration
    Miggl Level 1 Level 1 (75 points)

    Have you tried restarting the server? This seems to have "fixed" the issue for now for me. Not sure if it will come back or not.

  • 5. Re: Wiki SQL error: Server 2 to 3 migration
    amidknight Level 1 Level 1 (10 points)

    Yep. Tried restarting machine. Quit server.app - restart - turn server.app back on. Turned Wiki off - then back on...still same. Glad you got yours sorted, even if it only turns out to be temporary.


    Edit: I am going to stop trying to fix it, and just hold out for the service representative though.

  • 6. Re: Wiki SQL error: Server 2 to 3 migration
    kopfstandmedia Level 1 Level 1 (0 points)

    Same error over here. Did you get a answer jet?

  • 7. Re: Wiki SQL error: Server 2 to 3 migration
    amidknight Level 1 Level 1 (10 points)

    In progress with Apple. Will let everyone know what happens.

  • 8. Re: Wiki SQL error: Server 2 to 3 migration
    kopfstandmedia Level 1 Level 1 (0 points)

    When using Mountain Lion I moved the services data to an external Volume due to the serious amount of diskspace the Software-Update Service is requirering. Because of the error I'm having I decided to move the services data back to the main hdd – but while trying I get this error message:


    Bildschirmfoto 2013-10-29 um 00.08.25.png


    Maybe that helps for finding a solution.

  • 9. Re: Wiki SQL error: Server 2 to 3 migration
    kopfstandmedia Level 1 Level 1 (0 points)

    UPDATE: This message got nothing to do with the DB-error. Somehow the server was still writing backup files while moving the data. This resulted in a backup file – which was partial at the time of the moving process started – not being partial anymore by the time that specific file was supposed to be moved. WORKAROUND: Watch the file during the moving process and rename it back to partial, when filename changed. RESULT: After the server data moving process succeded everything was back to »normal« – meaning: the DB-error is still present.

  • 10. Re: Wiki SQL error: Server 2 to 3 migration
    amidknight Level 1 Level 1 (10 points)

    After a few days speaking with the kind folks at Apple, we (I) decided it was time to just start over and wait to see if a manual migration script would be created or an updated version of the app would be released.


    I went my Time Capsule backup and restored the last working version of the wiki - exported the pages I still thought had value to PDF - and wiped the slate clean. Set everything up with some better options than the original setup I had.


    Ultimately I'm okay with this chosen course, because it allowed me to do some house cleaning, keep a backup of the wiki just in case a true solution is found, and continue on with my work with a better setup than the one I had.


    Sorry I couldn't have better news related to this specific problem - the engineers did say that it was one of the only cases they had seen with my specific problem.