# Update the exposurelog teststand to work with the new postgres butler

XMLWordPrintable

#### Details

• Type: Story
• Status: Done
• Resolution: Done
• Fix Version/s: None
• Component/s: None
• Labels:
• Story Points:
2
• Sprint:
TSSW Sprint - Oct 24 - Nov 07
• Team:
Telescope and Site
• Urgent?:
No

#### Description

The Tucson teststand butler registries are now in postgres, with secrets.

Kian-Tat Lim suggests setting these two environment variables:

The data is available in the source of secrets that exposurelog already uses.

#### Activity

Hide
Russell Owen added a comment - - edited
Show
Russell Owen added a comment - - edited Pull requests: https://github.com/lsst-sqre/phalanx/pull/1796 https://github.com/lsst-sqre/exposurelog/pull/57 https://github.com/lsst-sqre/exposurelog/pull/58
Hide
Kian-Tat Lim added a comment -

As mentioned on SLAC, I think this is actually the wrong way to go. We should use Postgres mechanisms to give the account you're already using access to the Butler schemas.

Show
Kian-Tat Lim added a comment - As mentioned on SLAC, I think this is actually the wrong way to go. We should use Postgres mechanisms to give the account you're already using access to the Butler schemas.
Hide
Kian-Tat Lim added a comment -

OK, so you'll use the original env vars to get access for the exposurelog code and the "new" PG* env vars to allow the Butler to get access, all with the same credentials. That seems reasonable, although you could theoretically get rid of the original ones.

Show
Kian-Tat Lim added a comment - OK, so you'll use the original env vars to get access for the exposurelog code and the "new" PG* env vars to allow the Butler to get access, all with the same credentials. That seems reasonable, although you could theoretically get rid of the original ones.
Hide
Russell Owen added a comment -

I would much rather have two sets of credentials in case we ever want to make the butler credentials different than the exposurelog database credentials.

Show
Russell Owen added a comment - I would much rather have two sets of credentials in case we ever want to make the butler credentials different than the exposurelog database credentials.
Hide
Russell Owen added a comment - - edited

Tagged exposurelog 0.9.6 (after fixing deployment issues in 0.9.5).

Deployment succeeded on the summit but failed on the Tucson test stand with:

Failed to instantiate Butler from config file:///volume_1/butler.yaml.
ERROR: Traceback (most recent call last):
File "/opt/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context
self.dialect.do_execute(
File "/opt/venv/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute
cursor.execute(statement, parameters)
psycopg2.errors.InsufficientPrivilege: permission denied for schema lsstcomcam
LINE 2: FROM lsstcomcam.butler_attributes

Show
Russell Owen added a comment - - edited Tagged exposurelog 0.9.6 (after fixing deployment issues in 0.9.5). Deployment succeeded on the summit but failed on the Tucson test stand with: Failed to instantiate Butler from config file:///volume_1/butler.yaml . ERROR: Traceback (most recent call last): File "/opt/venv/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 1900, in _execute_context self.dialect.do_execute( File "/opt/venv/lib/python3.10/site-packages/sqlalchemy/engine/default.py", line 736, in do_execute cursor.execute(statement, parameters) psycopg2.errors.InsufficientPrivilege: permission denied for schema lsstcomcam LINE 2: FROM lsstcomcam.butler_attributes See https://tucson-teststand.lsst.codes/argo-cd/applications/exposurelog?view=tree&resource=&node=%2FPod%2Fexposurelog%2Fexposurelog-9d4cdd9fd-gpkhh%2F0&tab=logs
Hide
Kian-Tat Lim added a comment - - edited

The problem was that I forgot that we need these commands as well, which Joshua Hoblitt has now run for us:

 GRANT USAGE ON SCHEMA latiss TO exposurelog; GRANT USAGE ON SCHEMA lsstcomcam TO exposurelog; 

 GRANT SELECT ON ALL TABLES IN SCHEMA latiss TO exposurelog; GRANT SELECT ON ALL TABLES IN SCHEMA lsstcomcam TO exposurelog; 

Show
Kian-Tat Lim added a comment - - edited The problem was that I forgot that we need these commands as well, which Joshua Hoblitt has now run for us: GRANT USAGE ON SCHEMA latiss TO exposurelog; GRANT USAGE ON SCHEMA lsstcomcam TO exposurelog; in addition to the two original commands to give access to the tables: GRANT SELECT ON ALL TABLES IN SCHEMA latiss TO exposurelog; GRANT SELECT ON ALL TABLES IN SCHEMA lsstcomcam TO exposurelog;

#### People

Assignee:
Russell Owen
Reporter:
Russell Owen
Reviewers:
Kian-Tat Lim
Watchers:
Kian-Tat Lim, Russell Owen