-
Notifications
You must be signed in to change notification settings - Fork 900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possible bug: ERROR: tried calling catalog_get when extension isn't loaded
even though the extension is loaded
#1682
Comments
Hey @shirshendubhowmick thanks for the report, you indicate that you have this running without issue on another database within the same instance of PG and it is running without issue? Just to confirm when you connected to the "new" database you ran CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE; while connected to the new database? I just wanted to confirm this before we marched ahead with additional troubleshooting!! |
@bboule Yes another database on the same instance is working perfectly fine. I tried running Both the DBs produced same output:
|
Update: upgraded version to |
Update: Tried a workaround to solve the issue, and it worked. Created a backup of the problematic DB using |
We've run into this error message before with having |
This looks like it is related to #1844, which is caused when |
Closing this since there was no activity. Feel free to reopen if the issue is still relevant. |
I've attempted a database migration twice following the steps:
And while no errors have occurred there, the restoring flag is still on. I cannot change that flag since my new DB is on Azure and I do not have permission to do so. Is there anything I can do to solve this? Note that while the flag is on, I can ingest new data without issues at least on first glance.
|
It seems like
We're using Timescale 2.3.0 with PG 11, Docker. Edit: I think this is happening under some certain circumstances. I just retried the above, and |
I run into this error message while restoring a backup.
However if you dig deeper, there is a related entry in TimescaleDB logs, but it was some lines before the final error message:
Just as a hint for anyone who stumbles upon this on the future. |
Hi @ilmagher, Thanks for making us aware of this problem. The error message indicates that the extension is not loaded correctly in your environment. Could you check that the setting
|
Hi @ilmagher, Thanks for getting back. Could you try to create an empty database on that database server and run a |
Hello @ilmagher, The error message Does the destination server contain any data or is /Users/mabarbaro/pg/data empty before you start the PostgreSQL server for the first time? |
@ilmagher Since we cannot reproduce it but it is generated by your installation, we should look into why the error is printed and if there are any internal settings that are wonky. The error can be printed for a few different reasons, so let's explore this. First reason is that mats=# show timescaledb.restoring;
timescaledb.restoring
-----------------------
off
(1 row) The other case is if the extension state is not valid for some reason, so let's check that. It is stored internally so we can access it by defining a function to read it. Below I read the version from the create procedure install_extension_state() as $body$
declare
ver text;
begin
select version into ver
from pg_available_extension_versions
where name = 'timescaledb' and installed;
execute format($$
create function extension_state() returns text
as '$libdir/timescaledb-%s', 'ts_extension_get_state'
language c
$$, ver);
end
$body$ language plpgsql; After this, the following should work: mats=# call install_extension_state() ;
CALL
mats=# select extension_state();
extension_state
-----------------
created
(1 row) The value should typically be You can drop the function after you're done. You should also check that the variable mats=# show timescaledb.update_script_stage;
ERROR: unrecognized configuration parameter "timescaledb.update_script_stage" The error is expected, which just means that you have not done an update (yet). If it shows a value, it would be good to know what value that is. |
Hmm... it seems that symbol is not compiled in, so no I do not think that you're missing an update. I managed to reproduce it by accident here so maybe I have a reproduction case. In my case, the state is "unknown", which would cause this error. One thing that caused an issue in my build here was also that I had |
The extension state is not easily accessible in release builds, which makes debugging issue with the loader very difficult. This commit introduces a new schema `timescaledb_debug` and makes the function `ts_extension_get_state` available also in release builds as `timescaledb_debug.extension_state`. See timescale#1682
The extension state is not easily accessible in release builds, which makes debugging issue with the loader very difficult. This commit introduces a new schema `timescaledb_debug` and makes the function `ts_extension_get_state` available also in release builds as `timescaledb_debug.extension_state`. See timescale#1682
The extension state is not easily accessible in release builds, which makes debugging issue with the loader very difficult. This commit introduces a new schema `timescaledb_debug` and makes the function `ts_extension_get_state` available also in release builds as `timescaledb_debug.extension_state`. See timescale#1682
Ok, then we know this is not the value of Sorry, but I think you have to follow the suggestion above to reinstall the extension for now. We do not have an easy way to "fix" the extension state. If I am able to create a reliable reproduction I will add information about it here. |
The extension state is not easily accessible in release builds, which makes debugging issue with the loader very difficult. This commit introduces a new schema `timescaledb_debug` and makes the function `ts_extension_get_state` available also in release builds as `timescaledb_debug.extension_state`. See timescale#1682
The extension state is not easily accessible in release builds, which makes debugging issue with the loader very difficult. This commit introduces a new schema `timescaledb_debug` and makes the function `ts_extension_get_state` available also in release builds as `timescaledb_debug.extension_state`. See timescale#1682
The extension state is not easily accessible in release builds, which makes debugging issue with the loader very difficult. This commit introduces a new schema `_timescaledb_debug` and makes the function `ts_extension_get_state` available also in release builds as `_timescaledb_debug.extension_state`. See timescale#1682
The extension state is not easily accessible in release builds, which makes debugging issue with the loader very difficult. This commit introduces a new schema `_timescaledb_debug` and makes the function `ts_extension_get_state` available also in release builds as `_timescaledb_debug.extension_state`. See timescale#1682
The extension state is not easily accessible in release builds, which makes debugging issue with the loader very difficult. This commit introduces a new schema `_timescaledb_debug` and makes the function `ts_extension_get_state` available also in release builds as `_timescaledb_debug.extension_state`. See timescale#1682
To debug issues with extension state not being correct we log extension state changes on `DEBUG1` level. See timescale#1682
To debug issues with extension state not being correct we log extension state changes on `DEBUG1` level. See timescale#1682
To debug issues with extension state not being correct we log extension state changes on `DEBUG1` level. See timescale#1682
To debug issues with extension state not being correct we log extension state changes on `DEBUG1` level. See timescale#1682
To debug issues with extension state not being correct we log extension state changes on `DEBUG1` level. See timescale#1682
The extension state is not easily accessible in release builds, which makes debugging issue with the loader very difficult. This commit introduces a new schema `_timescaledb_debug` and makes the function `ts_extension_get_state` available also in release builds as `_timescaledb_debug.extension_state`. See timescale#1682
To debug issues with extension state not being correct we log extension state changes on `DEBUG1` level. See #1682
The extension state is not easily accessible in release builds, which makes debugging issue with the loader very difficult. This commit introduces a new schema `_timescaledb_debug` and makes the function `ts_extension_get_state` available also in release builds as `_timescaledb_debug.extension_state`. See timescale#1682
The extension state is not easily accessible in release builds, which makes debugging issue with the loader very difficult. This commit introduces a new schema `_timescaledb_debug` and makes the function `ts_extension_get_state` available also in release builds as `_timescaledb_debug.extension_state`. See #1682
Probably restarting the server after the database is dropped as well, otherwise looks correct. |
Steps to reproduce(on my machine (v2.16.1) and get fix the subject error: -- Getting chunks works
SELECT show_chunks('hypertable_name');
-- Prepapring for restore
SELECT timescaledb_pre_restore();
-- Throws subject error
SELECT show_chunks('hypertable_name');
-- End up restore mode(I guess)
SELECT timescaledb_post_restore();
-- Getting chunks works again
SELECT show_chunks('hypertable_name') System {
"postgresql_version": "PostgreSQL 16.4 (Debian 16.4-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit",
"timescaledb_version": "2.16.1",
"sysname": "Linux",
"version": "#202408250733 SMP PREEMPT_DYNAMIC Sun Aug 25 07:54:49 UTC 2024",
"release": "6.11.0-061100rc5-generic",
"version_pretty": "Debian GNU/Linux 12 (bookworm)"
} Caution I'm not expert, so please be careful with my advice. |
Relevant system information:
Ubuntu Server 18.04.3 LTS
postgres --version
):11.6 (Ubuntu 11.6-1.pgdg18.04+1)
\dx
inpsql
):1.5.1
apt install
Describe the bug
Suddenly started getting error
ERROR: tried calling catalog_get when extension isn't loaded
while creating hypertable.There was no version upgrades made to the server.
NOTE: this issue is only happening on a particular DB, another DB on the same server is working fine
To Reproduce
Omiting this as this occured suddenly, not sure how to reproduce
Postgres logs
Here is some postgres logs that might be helpful
postgresql
serviceRunning a
\dx
on the problematic DB gives:Please let me know whatever additional logs / information required.
Thanks
The text was updated successfully, but these errors were encountered: