spectacles-ci / spectacles

A continuous integration tool for Looker and LookML.
https://spectacles.dev
MIT License
217 stars 35 forks source link

LookML Validation facing Unexpected Read error #725

Open enrique-villarrealp opened 1 year ago

enrique-villarrealp commented 1 year ago
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 commented 1 year ago

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 commented 1 year ago

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

DylanBaker commented 1 year ago

@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.

LProcopi15 commented 1 year ago

@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?

enrique-villarrealp commented 1 year ago

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

LProcopi15 commented 1 year ago

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

enrique-villarrealp commented 1 year ago

@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.

LProcopi15 commented 1 year ago

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 commented 1 year ago

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