Comments (14)
@n8henrie I had the same problem, and probably related information: I was using a lot of concurrent calls.
I found the process that has locked the file and it seems to be:
oezgen 637 0.0 0.2 4681680 26532 ?? S 5Nov19 183:07.43 /Applications/Google Chrome.app/Contents/Frameworks/Google Chrome Framework.framework/Versions/78.0.3904.70/Helpers/Google Chrome Helper.app/Contents/MacOS/Google Chrome Helper --type=utility --field-trial-handle=1718379636,13217150702388057384,3641183978531146804,131072 --lang=en-US --service-sandbox-type=network --service-request-channel-token=5198092952403259345
I think Google Chrome was also using the cookies for the same pages
So I'm not sure what in particular caused the problem but for those who ended up here and looking for quick fix (on mac):
fuser /Users/<USERNAME_HERE>/Library/Application\ Support/Google/Chrome/Default/Cookies
/Users/oezgen/Library/Application Support/Google/Chrome/Default/Cookies: <SOME_PID>
kill -9 <SOME_PID>
from pycookiecheat.
Huh, thanks for the report. Can I ask about your use case? Are you retrieving cookies for thousands of URLs at once? Or doing so over time (i.e. a long-running process)?
Are you browsing while requesting the cookies? I know Chrome does lock the file at times; I generally recommend quitting the application prior to using pycookiecheat to avoid issues here.
from pycookiecheat.
I have a list of 30k URLs. I am processing them one by one over time. The whole process usually take 1+ hour. Sometimes it finishes fine from beginning to end, sometimes it has this glitch 2-3 times during the process.
I occasionally browse the site to keep session live. The glitch happen on its own, not when I am browsing.
from pycookiecheat.
Yes, I have also run into a similar intermittent error when trying to access the cookie file while Chrome is running. I don't know of a better solution than not running while browsing, since Chrome seems to lock the database on occasion.
Perhaps there are some sqlite flags to open with read-only access that bypass locking concerns?
from pycookiecheat.
This issue has been automatically marked as stale because it has not had recent activity or it has not had a response to a question in 14 days. It will be closed automatically if no further activity occurs within 7 days. Thank you for your contributions.
from pycookiecheat.
Looks like this may be out of my control:
Unclear if adding ?mode=ro
may help: https://docs.python.org/3.8/library/sqlite3.html#sqlite3.connect
from pycookiecheat.
Please see if 230574e helps
from pycookiecheat.
Bump.
This issue is pending a response and is blocked until I have more info. To keep the issue list groomed, I will often close these stalled issues if they go a prolonged time without a response. In this case, I will give it another week or so.
from pycookiecheat.
This issue has been automatically marked as stale because it has not had recent activity or it has not had a response to a question in 14 days. It will be closed automatically if no further activity occurs within 7 days. Thank you for your contributions.
from pycookiecheat.
Thanks for chiming in. Would you mind trying the dev branch (which includes the commit linked above to open in read-only mode) and see if you still have this issue?
from pycookiecheat.
@n8henrie thanks for the quick fix (and sorry for the late reply from my side)
I haven't had this problem since my last comment, although I am still using a lot of concurrent calls. I'm not sure how I triggered it before...
I will start using dev branch with pycookiecheat and post more details here if I encounter the same issue again.
from pycookiecheat.
Sounds good, thanks for the update.
from pycookiecheat.
@n8henrie commented on Jan 26, 2020, 5:53 PM GMT+3:30:
Thanks for chiming in. Would you mind trying the dev branch (which includes the commit linked above to open in read-only mode) and see if you still have this issue?
Is this commit still in the dev branch? I just installed git+https://github.com/n8henrie/pycookiecheat.git@dev
, and I still get
Traceback (most recent call last):
File "<string>", line 7, in <module>
File "/Users/evar/anaconda/lib/python3.7/site-packages/pycookiecheat/pycookiecheat.py", line 248, in chrome_cookies
) in conn.execute("PRAGMA table_info(cookies)"):
sqlite3.OperationalError: database is locked
from pycookiecheat.
Comparing the commit I linked above: 230574e with the current dev branch:
it looks like it is.So I guess that commit didn't prevent the issue, though it still seems like a good idea (since there's no reason my library should be modifying anything at this point).
So I think there is some other process, likely Chrome or a leftover background process from Chrome but possibly something else, that has the db locked.
from pycookiecheat.
Related Issues (20)
- GLib.Error: g-io-error-quark problem HOT 7
- Depend on pycryptodome instead of pycrypto HOT 5
- valueError: Namespace Secret not available HOT 1
- GLib.GError: g-io-error-quark: Cannot autolaunch D-Bus without X11 $DISPLAY (0) HOT 2
- chrome_cookies(url) : UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 0: invalid start byte HOT 8
- Empty response HOT 2
- UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb9 in position 3: invalid start byte HOT 37
- cookies expire in day or in random time HOT 1
- Two-factor authentication HOT 5
- chrome v96.0.4664.93 Cookie file is not in 'Google\Chrome Dev\User Data\Default\Cookies' HOT 7
- Enhancement: support the Slack app's cookies HOT 5
- Which is default, Chromium or Chrome? HOT 1
- Warning messages could be very helpful HOT 1
- Firefox support wanted? HOT 5
- browser = Slack now gives "TypeError: key_material must be bytes-like" HOT 5
- Windows alternative ? HOT 1
- is there a reason for cryptography 3.4.6 and not 41.0.3 ? HOT 5
- Consider using rookie as cookies extractor HOT 4
- Provide a command-line tool
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pycookiecheat.