Unable to run cdb_cartodbfytable.
version:
commit 727ec0c13b3d14a35cb7103d925988dda2d5d06b (HEAD, tag: v4.32.0)
```json
❯ curl -X GET -k "https://localhost.lan/user/rasul/api/v2/sql?api_key=${api_key}&q=CREATE+TABLE+rasul.upload_example2+(the_geom+geometry,name+text,age+integer)"
❯ curl -X GET -k "https://localhost.lan/user/rasul/api/v2/sql?api_key=${api_key}&q=SELECT+CDB_CartodbfyTable('rasul','upload_example2')" | jq
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 372 0 372 0 0 279 0 --:--:-- 0:00:01 --:--:-- 279
{
"rows": [
{
"cdb_cartodbfytable": "upload_example2"
}
],
"time": 0.169,
"fields": {
"cdb_cartodbfytable": {
"type": "regclass",
"pgtype": "regclass"
}
},
"total_rows": 1,
"warnings": [
"Error calling Invalidation Service to link Ghost Tables: Error 111 connecting to 127.0.0.1:3142. Connection refused."
],
"notices": [
"_CDB_LinkGhostTables() called with username=rasul, event_name=DROP TRIGGER"
]
}
````
"Error calling Invalidation Service to link Ghost Tables: Error 111 connecting to 127.0.0.1:3142. Connection refused." and table isn't showing up on dashboard.
Table should be registered and show up in dashboard
commit 727ec0c13b3d14a35cb7103d925988dda2d5d06b (HEAD, tag: v4.32.0)
Needed to use the copyfrom API
@sabman Hi! That is not an error, but a warning. Invalidation Service is not really required to "cartodbfy" tables. It's used to register the tables without having to open the dashboard, but if you open it, it should do it and show the new table. Are you able to see it?
No that's the issue - I don't see the table either. So it's not registering the table for the dashboard and it's essentially a ghost table. I can query the table via the SQL API but it's not on the dashboard
I found an older version of carto with the rake task called cartodb:db:register_ghost_table The table shows up if I run this task for my [user,table], though it still gives this warning:
WARNING: Error calling Invalidation Service to link Ghost Tables: Error 111 connecting to 127.0.0.1:3142.
Questions:
Cartodbfying not working? Seems it should do the table registration too.cartodb:db:register_ghost_table task was removed?why is Cartodbfying not working? Seems it should do the table registration too.
The purpose of CDB_CartodbfyTable is to create the required columns and other stuff to allow CARTO to use it (more info here). Is the table being updated? Regarding the registration, if you don't have the Invalidation Service, it should be done when you enter the dashboard, as I said. You need the ghost_tables feature flag for this, do you have it enabled?
any thoughts on why the cartodb:db:register_ghost_table task was removed?
No idea... You can also run Carto::GhostTablesManager.new(user_id).link_ghost_tables if you want to do it manually.
any way to fix the Invalidation Service warnings? (is it important?)
It's not important.
Thank you so much enabling the ghost_tables feature flag did the trick. Probably should be enabled by default, what do you think? 🤔In either case thanks for the help. Closing this for now.
Most of the users don't need this feature because they create their maps directly from the dashboard, and enabling it by default could affect the performance.
Anyway, I'm glad it's working for you now.
Thank you so much enabling the
ghost_tablesfeature flag did the trick. Probably should be enabled by default, what do you think? In either case thanks for the help. Closing this for now.
@sabman I am facing the same issue and trying to do your trick. I however cant figure out how to enable the ghost_tables. When I run bundle exec rake cartodb:db:register_ghost_table I get an error Don't know how to build task 'cartodb:db:register_ghost_table'
Trick is to add the feature flag to the database first. Give this a try.
# Add Feature Flag and Eable GhostTables:
bundle exec rake cartodb:features:add_feature_flag[ghost_tables,false]
bundle exec rake cartodb:features:enable_feature_for_all_users[ghost_tables]
--
CoFounder https://getgeodb.com
Most helpful comment
Trick is to add the feature flag to the database first. Give this a try.
--
CoFounder https://getgeodb.com