Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1irPRp-0006Jv-VT for pgsql-general@arkaria.postgresql.org; Tue, 14 Jan 2020 16:53:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1irPRo-0007ps-OJ for pgsql-general@arkaria.postgresql.org; Tue, 14 Jan 2020 16:53:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1irPRm-0007pk-W9 for pgsql-general@lists.postgresql.org; Tue, 14 Jan 2020 16:53:44 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1irPRg-0002ko-W0 for pgsql-general@lists.postgresql.org; Tue, 14 Jan 2020 16:53:42 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 1EC5F21A4B; Tue, 14 Jan 2020 11:53:34 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 14 Jan 2020 11:53:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=P W895wlM8IlNqB9wE5TiLWQsKb7ax4vZyfWFR7V2ugw=; b=C5iMTiF2g8Om55gwA NhOk+xIyJHhIKiIZ1MoPRYBU4nlSy2r5aQtNth148wm7FR/Jy1KRQmFwE/ARimPH Ikjw+dq7/K/bUohhQvm4tgpOfezqU3UgUDxL2nEp8w/cPUVRq0smxP3oWBeqrvZO +2rpQg3eOL9a7h2+d4c3vhOssEtdoz468ui9Pes04Xu8vq17Ng2pectZWtp0ERJT Y5WPaMQDtf8wKdQxFx9sEJnnhwsjwVpxOVWkrEM7QsEHC6Mygf0WDQsrMrxR3gbX seqkfseeSeuXk39UiSvil8XLuc82omHWxGiOFMKRI9QG0xgzpeSTRcPJ6QFHs6Wd 0HKYg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=PW895wlM8IlNqB9wE5TiLWQsKb7ax4vZyfWFR7V2u gw=; b=ZpIbTuGcJ26CYIXaNEkwOwDr9GCLd8uXarAq8apSn3jJsJfOQShmgaann 7w8nv26xHuXvwnxjxoeAkhAf5NOcs6w3XdlP4d5Isac9xu7E+rsC3DuoAPyLOGy+ OWGeEOXP21XWUfYB0blouUx6TO7Lpb0Elb8Sxj8bfINpzqd/7dZIUxE09mVQK++9 H9rWlwP6fHH02kfOzafy4YwgctJhZieAdi3GrqGS4aPSFAS9U3EazdmuX3t+QT6r eA+ikkKkolo6y+9LW3xU3a6Ord8whHLA9EoSJsa5lZpVTARosn2Q7Gfcozjqj1/G DEEkyjCohr70SxQ20bCf8LFA0o+Kg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrtddugddtudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculddquddtmdenucfjughrpefuvfhfhffkffgfgggjtgfgsehtkeertddt feejnecuhfhrohhmpeetughrihgrnhcumfhlrghvvghruceorggurhhirghnrdhklhgrvh gvrhesrghklhgrvhgvrhdrtghomheqnecuffhomhgrihhnpehgihhthhhusgdrtghomhdp nhhorhhthhdrghhovhdptggrrhhlvghonhdrghhovhdpuddvjedrtddrtddrudenucfkph epjedurddvuddvrdduvdelrdduleefnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrughr ihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhmnecuvehluhhsthgvrhfuihiivg eptd X-ME-Proxy: Received: from [192.168.1.10] (unknown [71.212.129.193]) by mail.messagingengine.com (Postfix) with ESMTPA id 88D4C30600A8; Tue, 14 Jan 2020 11:53:33 -0500 (EST) Subject: Re: Error retrieving PostgreSQL DB information with Coturn To: Marco Ippolito , pgsql-general@lists.postgresql.org References: From: Adrian Klaver Message-ID: Date: Tue, 14 Jan 2020 08:53:32 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 1/14/20 8:33 AM, Marco Ippolito wrote: > In order to understand how to use Postgresql-11 with Coturn, > https://github.com/coturn/coturn , > I created a postgresql-11 dabatase using > /usr/local/share/turnserver/schema.sql  : > >     CREATE TABLE turnusers_lt ( >         realm varchar(127) default '', >         name varchar(512), >         hmackey char(128), >         PRIMARY KEY (realm,name) >     ); > >     CREATE TABLE turn_secret ( >             realm varchar(127) default '', >             value varchar(256), >             primary key (realm,value) >     ); > >     CREATE TABLE allowed_peer_ip ( >             realm varchar(127) default '', >             ip_range varchar(256), >             primary key (realm,ip_range) >     ); > >     CREATE TABLE denied_peer_ip ( >             realm varchar(127) default '', >             ip_range varchar(256), >             primary key (realm,ip_range) >     ); > >     CREATE TABLE turn_origin_to_realm ( >             origin varchar(127), >             realm varchar(127), >             primary key (origin) >     ); > >     CREATE TABLE turn_realm_option ( >             realm varchar(127) default '', >             opt varchar(32), >             value varchar(128), >             primary key (realm,opt) >     ); > >     CREATE TABLE oauth_key ( >             kid varchar(128), >             ikm_key varchar(256), >             timestamp bigint default 0, >             lifetime integer default 0, >             as_rs_alg varchar(64) default '', >             realm varchar(127), >             primary key (kid) >     ); > > > But when trying to execute secure_relay_with_db_psql.sh : > >     (base) > marco@marco-U36SG:~/turnserver-4.5.0.8/examples/scripts/longtermsecuredb$ >     ./secure_relay_with_db_psql.sh >     0: WARNING: Cannot find config file: turnserver.conf. Default and > command-line settings will be >     used. >     0: Listener address to use: 127.0.0.1 >     0: Listener address to use: ::1 >     0: Relay address to use: 127.0.0.1 >     0: Relay address to use: ::1 >     0: 3000000 bytes per second allowed per session >     0: WARNING: Cannot find config file: turnserver.conf. Default and > command-line settings will >        be used. >     0: RFC 3489/5389/5766/5780/6062/6156 STUN/TURN Server >     Version Coturn-4.5.0.8 'dan Eider' >     0: Max number of open files/sockets allowed for this process: 4096 >     0: Due to the open files/sockets limitation, >     max supported number of TURN Sessions possible is: 2000 (approximately) >     0: ==== Show him the instruments, Practical Frost: ==== > >     0: TLS supported >     0: DTLS supported >     0: DTLS 1.2 supported >     0: TURN/STUN ALPN supported >     0: Third-party authorization (oAuth) supported >     0: GCM (AEAD) supported >     0: OpenSSL compile-time version: OpenSSL 1.1.1  11 Sep 2018 > (0x1010100f) >     0: SQLite is not supported >     0: Redis supported >     0: PostgreSQL supported >     0: MySQL supported >     0: MongoDB is not supported >     0: >     0: Default Net Engine version: 3 (UDP thread per CPU core) > >     ===================================================== > >     0: Domain name: >     0: Default realm: north.gov >     0: oAuth server name: blackdow.carleon.gov > >     0: WARNING: cannot find certificate file: turn_server_cert.pem (1) >     0: WARNING: cannot start TLS and DTLS listeners because certificate > file is not set properly >     0: WARNING: cannot find private key file: turn_server_pkey.pem (1) >     0: WARNING: cannot start TLS and DTLS listeners because private key > file is not set properly >     Cannot create pid file: /var/run/turnserver.pid: Permission denied >     0: Cannot create pid file: /var/run/turnserver.pid >     0: pid file created: /var/tmp/turnserver.pid >     0: IO method (main listener thread): epoll (with changelist) >     0: Wait for relay ports initialization... >     0:   relay 127.0.0.1 initialization... >     0:   relay 127.0.0.1 initialization done >     0:   relay ::1 initialization... >     0:   relay ::1 initialization done >     0: Relay ports initialization done >     0: IO method (general relay thread): epoll (with changelist) >     0: turn server id=0 created >     0: IPv4. SCTP listener opened on : 127.0.0.1:3478 > >     0: IPv4. TCP listener opened on : 127.0.0.1:3478 > >     0: IPv4. SCTP listener opened on : 127.0.0.1:3479 > >     0: IPv4. TCP listener opened on : 127.0.0.1:3479 > >     0: IPv6. SCTP listener opened on : ::1:3478 >     0: IPv6. TCP listener opened on : ::1:3478 >     0: IPv6. SCTP listener opened on : ::1:3479 >     0: IPv6. TCP listener opened on : ::1:3479 >     0: IO method (general relay thread): epoll (with changelist) >     0: turn server id=1 created >     0: IPv6. TCP listener opened on : ::1:3479 >     0: IPv6. UDP listener opened on: ::1:3479 >     0: Total General servers: 3 >     0: IO method (auth thread): epoll (with changelist) >     0: IO method (auth thread): epoll (with changelist) >     0: IO method (admin thread): epoll (with changelist) >     0: IPv4. CLI listener opened on : 127.0.0.1:5766 > >     0: PostgreSQL DB connection success: host=localhost dbname=coturn > user=turn password=turn >     connect_timeout=30 >     0: ERROR: Error retrieving PostgreSQL DB information: ERROR: >  permission denied for table >     allowed_peer_ip > > But these are the tables of coturndb : > >     coturn=# \dt >                     List of relations >          Schema |         Name         | Type  |  Owner >         --------+----------------------+-------+---------- >          public | admin_user           | table | postgres >          public | allowed_peer_ip      | table | postgres >          public | denied_peer_ip       | table | postgres >          public | oauth_key            | table | postgres >          public | turn_origin_to_realm | table | postgres >          public | turn_realm_option    | table | postgres >          public | turn_secret          | table | postgres >          public | turnusers_lt         | table | postgres >     (8 rows) > >     coturn=# \d allowed_peer_ip >                               Table "public.allowed_peer_ip" >       Column  |          Type          | Collation | Nullable | >  Default > > ----------+------------------------+-----------+----------+----------------------- >      realm    | character varying(127) |           | not null | > ''::character varying >      ip_range | character varying(256) |           | not null | >     Indexes: >         "allowed_peer_ip_pkey" PRIMARY KEY, btree (realm, ip_range) > >     coturn=# \d denied_peer_ip >                               Table "public.denied_peer_ip" >       Column  |          Type          | Collation | Nullable | >  Default > > ----------+------------------------+-----------+----------+----------------------- >      realm    | character varying(127) |           | not null | > ''::character varying >      ip_range | character varying(256) |           | not null | >     Indexes: >         "denied_peer_ip_pkey" PRIMARY KEY, btree (realm, ip_range) > >     coturn=# \d turn_secret >                                Table "public.turn_secret" >      Column |          Type          | Collation | Nullable | >  Default > > --------+------------------------+-----------+----------+----------------------- >      realm  | character varying(127) |           | not null | > ''::character varying >      value  | character varying(256) |           | not null | >     Indexes: >         "turn_secret_pkey" PRIMARY KEY, btree (realm, value) > > Why it says "probably, the tables 'allowed_peer_ip' and/or > 'denied_peer_ip' have to be upgraded to include the realm column" ? Have no idea, probably need to see if someone answers that in response to your issue: https://github.com/coturn/coturn/issues/484 > Why it says "permission denied" for table turn_secret and for table > allowed_peer_ip? 0: PostgreSQL DB connection success: host=localhost dbname=coturn user=turn password=turn connect_timeout=30 List of relations Schema | Name | Type | Owner --------+----------------------+-------+---------- ... public | allowed_peer_ip | table | postgres ... public | turn_secret | table | postgres You are connecting as user turn and trying to access tables owned by user postgres. > How to solve the problem? > > Marco -- Adrian Klaver adrian.klaver@aklaver.com