When trying to update user profiles via the Services module (not via drupal) - calling mysite.com/drupalgap/user/1.json as a POST with correct parameters - I'm getting the following error:

500 Internal Server Error : An error occurred (42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mydbname.services_user' doesn't exist

I've cleared all my caches but the problem persists. In fact, the cache table rebuilds itself with the a serialized reference to a services_user table in schema row. The line is huge, but here's the part with that reference:

s:13:"services_user";a:3:{s:6:"fields";a:3:{s:3:"uid";a:3:{s:4:"type";s:3:"int";s:8:"unsigned";b:1;s:8:"not null";b:1;}s:7:"created";a:3:{s:4:"type";s:3:"int";s:8:"not null";b:1;s:7:"default";i:0;}s:7:"changed";a:3:{s:4:"type";s:3:"int";s:8:"not null";b:1;s:7:"default";i:0;}}s:6:"module";s:8:"services";s:4:"name";s:13:"services_user";}s:8:"smart_ip";a:5:{s:6:"fields";a:8:{s:8:"geoip_id";a:3:{s:4:"type";s:3:"int";s:4:"size";s:3:"big";s:8:"not null";b:1;}s:6:"ip_ref";a:3:{s:4:"type";s:3:"int";s:4:"size";s:3:"big";s:8:"not null";b:1;}s:12:"country_code";a:3:{s:4:"type";s:7:"varchar";s:6:"length";i:3;s:8:"not null";b:1;}s:6:"region";a:3:{s:4:"type";s:7:"varchar";s:6:"length";i:3;s:8:"not null";b:0;}s:4:"city";a:3:{s:4:"type";s:7:"varchar";s:6:"length";i:128;s:8:"not null";b:0;}s:3:"zip";a:3:{s:4:"type";s:7:"varchar";s:6:"length";i:8;s:8:"not null";b:0;}s:8:"latitude";a:3:{s:4:"type";s:5:"float";s:4:"size";s:3:"big";s:8:"not null";b:1;}s:9:"longitude";a:3:{s:4:"type";s:5:"float";s:4:"size";s:3:"big";s:8:"not null";b:1;}}

I currently have two Services configured. One is drupalgap and the other is my own custom for specialized queries and API needs. I've tried enabling / disabling a variety of resources in both my Service endpoints. Both have session authentication enabled, use a REST server, return json formats, and include a variety of resources including all of those user system, drupalgap_user, and user.

What should i do about this missing 'services_user' table?


1 Answer 1


That table was added in Services 7.x-3.10; it sounds like one of three things has happened:

  1. You've updated the module but not run the database updates. If you have drush run drush updb, or visit /update.php to go through the process.
  2. You've already run the updates but something went wrong
  3. The table was removed accidentally (maybe by a backup restore)

In either of the last two cases, you can install the table manually with:

$schema = drupal_get_schema_unprocessed('services');         
db_create_table('services_user', $schema['services_user']);


module_load_include('install', 'services');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.