spectacles icon indicating copy to clipboard operation
spectacles copied to clipboard

LookML Validation facing Unexpected Read error

Open enrique-villarrealp opened this issue 2 years ago • 9 comments

image

We've started facing this weird issue, somewhat inconsistently. Some PRs are triggering it, some PRs aren't. Has anyone faced this before?

One PR seemed to fix this by adding an unrelated LAMS exception, though I'm not sure why this would happen.

enrique-villarrealp avatar Jul 27 '23 09:07 enrique-villarrealp

Forcing the CI jobs to run in debug mode doesn't point to any issue, but does make the CI successful...

Edit: lucky runs I guess, this is not a consistent solution. Back to square one

enrique-villarrealp avatar Jul 27 '23 10:07 enrique-villarrealp

Could this be because of the concurrency problem? Having multiple PRs trigger the check at once

enrique-villarrealp avatar Jul 27 '23 10:07 enrique-villarrealp

@enrique-villarrealp, would you mind sharing the full logs from a run when running in verbose -v mode please?

This isn't behaviour we have seen before. It could theoretically be due to concurrency. It's possible that Looker doesn't like the same user running two LookML validations simultaneous (or that the changing of the branch mid-validation is causing the issue). As we talk about in our docs, we can't really support multiple simultaneous runs with the same user's credentials because of how Looker handles it.

DylanBaker avatar Jul 28 '23 11:07 DylanBaker

@DylanBaker we're running into the same issue. Similar to @enrique-villarrealp this issue is only happening intermittently. To recreate, I opened a new branch and edited some LookML. No one else on the team has run the CI job since yesterday and no one else on the team is working off of this branch, so there should not be an issue with concurrency.

Error Details

On the first CI run the job on my new branch, the CI failed. I ran in verbose mode and here are the logs:

image image image

I then re-triggered a run of the job in Github and it ran without error.

Some Additional Context

Here's the contexts of our Github action yml
name: Spectacles CI Run

on:
  pull_request:
    paths:
      - 'looker/**.lkml'
  workflow_dispatch:

concurrency:
  group: spectacles-validate
  cancel-in-progress: true

jobs:
  spectacles-validate:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash
        working-directory: dbt

    env:
      HEAD_REF: ${{ github.head_ref }}
      LOOKER_BASE_URL: ${{ secrets.LOOKER_BASE_URL }}
      LOOKER_CLIENT_ID: ${{ secrets.LOOKER_CLIENT_ID }}
      LOOKER_CLIENT_SECRET: ${{ secrets.LOOKER_CLIENT_SECRET }}

    steps:
      - uses: actions/checkout@v3

      - uses: actions/setup-python@v4
        with:
          python-version: 3.9

      - name: Install dependencies
        run: pip install spectacles pydantic==1.10.9

      - name: Validate LookML Syntax
        run: bash ../etc/ci.run-spectacles-lookml.sh
Here's the contexts of ci.run-spectacles-lookml.sh referenced in the action yml
    spectacles lookml \
        --base-url ${LOOKER_BASE_URL} \
        --client-id ${LOOKER_CLIENT_ID} \
        --client-secret ${LOOKER_CLIENT_SECRET} \
        --project replicated \
        --branch ${HEAD_REF} \
        -v

Any thoughts on what might be causing this?

LProcopi15 avatar Aug 23 '23 16:08 LProcopi15

Ah, dang. I missed this. Recently it's been working better for us, but should we see that again, I will share the logs.

enrique-villarrealp avatar Aug 23 '23 17:08 enrique-villarrealp

@enrique-villarrealp did you make any changes to help resolve this?

LProcopi15 avatar Aug 28 '23 18:08 LProcopi15

@enrique-villarrealp did you make any changes to help resolve this?

Not really, sadly :/ We mostly advise the user to re-run the job like you did, and eventually it works.

enrique-villarrealp avatar Aug 29 '23 06:08 enrique-villarrealp

Closing the loop on this in event anyone else is having the issue! We pinned pydantic==1.10.9 in early July when the release of pydantic 2.0.0 was causing compatibility issues with Spectacles. The Specatacles team resolved this by pinning "pydantic<2.0.0" on July 3rd (https://github.com/spectacles-ci/spectacles/pull/724), but we never went back and removed our pinned version.

I removed it and now everything is running smoothly 🎉

LProcopi15 avatar Aug 30 '23 16:08 LProcopi15

Just kiddinggg :/ still getting the error sometimes. Will continue to look into this this week...

LProcopi15 avatar Sep 05 '23 16:09 LProcopi15