简体   繁体   中英

Python SQLite3 fails on Github Actions but not on local

I'm setting up CI using Github Actions and SQLite3 it's failing to insert on Github Actions but not on a local machine.

The line that fails is:

conn.execute("INSERT INTO sessions VALUES (?, ?, FALSE, NULL, ?)", [new_auth_token, device_id, expire_date])

This line is executed a few times in diferent tests succesfully, but then it fails in the rest of the tests (Always the same tests fail) with the next error.

sqlite3.OperationalError: no such column: FALSE

I'm using python3.8 and I've tried it on my computer with a fresh install of python and clone of the repository, but it never fails locally, only on GithuActions.

What fixed the problem for me is in my YAML workflow, replacing

runs-on: ubuntu-latest 

with

runs-on: ubuntu-20.04

ubuntu-latest uses Ubuntu 18.04 and the SQLite version seems to be old and have an issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM