DALServiceError with DP1 TAP queries

Hello! I started running into the same error message yesterday. I saw it first when I tried to connect to the TAP service with the API, but I am now also seeing the message when I submit a TAP query on an RSP notebook.

Update: After the 11/20 Thursday Patch, my RSP notebook aspect is working again when I make TAP queries, but the error still appears when I try to query with the API.

Hi @msredden , thanks for posting. To ensure this question is seen, I’ve moved it from being a reply post in a solved topic to being a new Support topic.

As @frossie requested in the other topic, I will bring this to our RSP tech team’s attention, as they had fixed the bug that was previously causing the error.

Could you say whether you had tried the temporary fix in the other topic, of logging out and back in, already?

Thank you!
Yes I’ve tried logging out and back in, as well as clearing all my sessions and tokens. Nothing’s worked yet.

Okay thank you for confirming things are working with the notebook, which means we probably fixed that problem. So to be clear the issue now is with an external (API) access to the TAP server? There are two “horses, not zebra” reasons this can be happening

  1. you are using a client that is not correctly using your access token
  2. you don’t have a valid access token.

To try and figure which (if any) of those could be the issue, can you

  1. describe how you are making the API query
  2. Go to your user token page and make sure you have a valid token with read:tap scope like in the screenshot below

… and report back.

Thank you for following up! Yes the issue was with external access to the TAP server, however when I tried recreating the issue just now, it suddenly started working fine. I’m not sure what if anything changed between my other attempts and this one, but it could have been some issue with adding my token. The code that is now working for me is below. When it wasn’t working, the error was occurring at the job.run() line.

import pyvo
import requests

TAP_URL = "https://data.lsst.cloud/api/tap"

tap_session = requests.Session()
tap_session.headers['Authorization'] = f"Bearer {TOKEN}"
svc = pyvo.dal.TAPService(
    TAP_URL,session = tap_session
)


query_simple = """SELECT coord_dec,
            coord_ra,
            g_cModelMag,
            shape_xx,
            shape_xy,
            shape_yy,
            refExtendedness
    FROM dp1.Object 
    WHERE CONTAINS(POINT('ICRS', coord_ra, coord_dec),CIRCLE('ICRS', 53.0871733, -28.0878248, 0.01))=1"""


job = svc.submit_job(query_simple)
job.run()