DBCleaner_API Credentials Issue? (

DBCleaner_API Credentials Issue? (

We have a few columns that we've removed from our database model over time and we always get the "Database Integrity Suggestions" about the missing colums, which we've always just ignored.

So I was very excited when I read in the release notes of that they're providing a new API to actually remove missing columns from the physical database. But when I went to use it, I received the following error:

Current user does not hold the necessary credentials for invoking this action

My user account has the proper roles to run anything in the module, and I even tried it as the Admin superuser account.

Does anyone have experience with this? We're full OutSystems customers running hosted on their cloud, if that matters.
Hi Len,

To call the methods Entity_ListDeleted, Entity_DropTable, Attribute_ListDeleted and Attribute_DropColumn you need two things:
  1. the module that consumes the DBCleaner_API must have "ServiceCenter" as User Provider eSpace
  2. the user logged in the consumer module must have the role "Administrator"
Can you please check this?
this Api isn't yet available for personal environments, right?
Hi Gonçalo,

As explained by Stoyan here, the API will only be available on your personal environment when it is upgraded to

João Rosado
But I already have upgraded service studio to version and still do not see DB Cleaner on references.
Gonçalo it is not a question of Service Studio. You need to have the Platform version installed with System_Components from that version published.
is something I can do André? If yes, where? Can you give some lights how to do it?


Best regards
You'll have to wait for your personal environment to be upgraded...
ah, ok!

Thanks for the explanation André.
Okay, so I was able to get this running and made a function that used the Attribute_ListDeleted function to find deleted attributes, and then ran a For Each loop to Attribute_DropColumn and here's what happened:

I'm still getting Database Integrity Suggestions that the things that it "deleted" are still in the database, but now the Attribute_ListDeleted returns no records, when it used to have a whole list of things we deleted. So, it cleared... but it didn't?

But more troubling, now we're getting Internal Errors on at least one of our tables:
Database Returned the following error:
View or function [databaseTable] has more column names specified than columns defined.

It looks right in ServiceStudio and I've also opened the same table referenced in the error directly with Microsoft SQL Server Management and the columns ARE listed there (if in a slightly different order than with SS).

What happened? How do I fix the errors I'm getting? This function seems to have caused some notable damage!
Update: So, I basically tried republishing the database module that was having problems, and it DID fix the issue, so republishing apparently undoes the breaking of existing modules.

However, (and I've confirmed this by opening SQL Server Mgmnt) the database cleanup apparently did not succeed in removing the deleted columns from the database.
Thank you for your feedback Len.

The error you found means that the column was dropped from the database but there are views in the database referencing that column.

This is a bug of the DBCleaner_API that occurs when you drop columns from multi-tenant entities. As workaround, if you want to drop columns from multi-tenant entities you need to republish the espace after dropping the column to force the recreation of the multi-tenant views.
We are working on fixing it for a next revision of the platform.

Is this your scenario? Dropping attributes from multi-tenant entities?

"However, (and I've confirmed this by opening SQL Server Mgmnt) the database cleanup apparently did not succeed in removing the deleted columns from the database."

This is very strange because if for some reason the column wasn't dropped from the database you would not have had the database error you described above. 

Can you check if the eSpace version you republished doesn't have the attribute in the entity model?