Quiver-alfred icon indicating copy to clipboard operation
Quiver-alfred copied to clipboard

NameError: global name 'db' is not defined

Open cogitoxin opened this issue 8 years ago • 25 comments

I've set the library path but when I try to search I'm getting Error NameError: global name 'db' is not defined.

Here is what I get from the debug model.

Starting debug for 'Quiver Search'

[2017-09-22 12:38:36][ERROR: input.scriptfilter] Code 1: 12:38:36 workflow.py:1692 DEBUG Data library_location stored in cpickle format 12:38:36 workflow.py:1707 DEBUG Stored data loaded from : /Users/cogito/Library/Application Support/Alfred 3/Workflow Data/com.cook.quiver/library_location.cpickle 12:38:36 workflow.py:1803 DEBUG Loading cached data from : /Users/cogito/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/com.cook.quiver/__workflow_update_status.cpickle 12:38:36 workflow.py:2379 DEBUG update_data : {u'available': False} 12:38:36 workflow.py:2167 DEBUG Workflow version : 0.4.0 12:38:36 workflow.py:1568 DEBUG Reading settings from ~/Library/Application Support/Alfred 3/Workflow Data/com.cook.quiver/settings.json ... 12:38:36 workflow.py:2451 DEBUG Update check not due 12:38:36 workflow.py:1692 DEBUG Data library_location stored in cpickle format 12:38:36 workflow.py:1707 DEBUG Stored data loaded from : ~/Library/Application Support/Alfred 3/Workflow Data/com.cook.quiver/library_location.cpickle 12:38:36 workflow.py:2185 ERROR global name 'db' is not defined Traceback (most recent call last): File "XXX/MEGAsync/Application/Alfred.alfredpreferences/workflows/user.workflow.9A9FF46C-2CBC-499D-A87B-53DCEB90A3CF/workflow/workflow.py", line 2178, in run func(self) File "run.py", line 44, in main db.connect() NameError: global name 'db' is not defined 12:38:36 workflow.py:2205 DEBUG Workflow finished in 0.018 seconds.

Please help.

cogitoxin avatar Sep 22 '17 16:09 cogitoxin

Same thing for me.

image

keeprock avatar Sep 28 '17 10:09 keeprock

Same issue for me.

dev2geek avatar Oct 26 '17 01:10 dev2geek

Hey guys - I'm sorry i've been MIA. I believe the PR above fixes this.

danielecook avatar Oct 26 '17 18:10 danielecook

Thanks for fast response! Still no luck. quiver.db is just empty.

keeprock avatar Oct 27 '17 16:10 keeprock

@keeprock did you clone the repo into your workflows folder?

danielecook avatar Oct 27 '17 16:10 danielecook

@danielecook Yes, I did. At first I just edit a line, as PR recommends.

After that, completely replace workflow folder. Check if commits changes was there. And still DB error.

Maybe there is something else is going on, because my Quiver.db file contains only indexes and empty tables.

keeprock avatar Oct 27 '17 17:10 keeprock

I've also check if it works at all with newly Quiver DB. It was. But then I connect with my working library - all went out.

keeprock avatar Oct 27 '17 17:10 keeprock

Hey @keeprock keeprock - can you add notes to the quiver db? It might need data...I'm not sure I ever tested it with a fresh database...

danielecook avatar Oct 27 '17 17:10 danielecook

@danielecook. My bad, Daniel. I guess I expressed myself incorrectly. My Db got notes.

What I was saying is that Workflow works with fresh DB with some notes in it which I created to test if Workflow even work. (DB is not empty). But it is NOT working with my DB (not empty too).

Thanks for your help. It may be that my DB is somehow corrupt or whatever. I'm already debugging code in hope to find where it broken.

keeprock avatar Oct 27 '17 18:10 keeprock

It works, thanks!

dev2geek avatar Oct 30 '17 01:10 dev2geek

Has this been fixed? I used the fixum workflow to fix Python libraries that were incompatible with my version of macOS (10.12.6), and that solved that problem but still getting the global name 'db' name is not defined error.

justnealpatel avatar Nov 09 '17 02:11 justnealpatel

I can confirm it solved the issue for me. That would be great to package a new release. Thx !

mickaelperrin avatar Nov 14 '17 23:11 mickaelperrin

Is the workflow accustomed to the nested folder structure introduced in version 3.1 of Quiver? That's what might be throwing mine off.

justnealpatel avatar Nov 17 '17 11:11 justnealpatel

Same error: workflow.py:2266 ERROR global name 'db' is not defined using Quiver 3.1.1

lisah2u avatar Nov 21 '17 19:11 lisah2u

same here NameError: global name 'db' is not defined 16:48:04 workflow.py:2205

Cyperwu avatar Jan 03 '18 08:01 Cyperwu

@cyberwu do you have notes in your database?

danielecook avatar Jan 03 '18 13:01 danielecook

@danielecook I have notes in my database and I'm having the same issue. I had a nested notebook but I removed it. Happy to provide any other helpful information.

austinjreilly avatar Jan 04 '18 00:01 austinjreilly

I'm also having this issue -- could it be due to the fact that my Quiver Library is stored in my "Dropbox (Personal)" folder, instead of merely Dropbox?

marlowe310 avatar Feb 14 '18 03:02 marlowe310

Can it automatically adjust to nested notebooks? I believe that's the main issue.

justnealpatel avatar Feb 14 '18 06:02 justnealpatel

Same issue here

Starting debug for 'Quiver Search'

[2018-02-15 15:41:33][ERROR: input.scriptfilter] Code 1: 15:41:32 workflow.py:1692 DEBUG    Data `library_location` stored in `cpickle` format
15:41:32 workflow.py:1707 DEBUG    Stored data loaded from : /Users/jklein/Library/Application Support/Alfred 3/Workflow Data/com.cook.quiver/library_location.cpickle
15:41:33 workflow.py:1803 DEBUG    Loading cached data from : /Users/jklein/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/com.cook.quiver/__workflow_update_status.cpickle
15:41:33 workflow.py:2379 DEBUG    update_data : {u'available': False}
15:41:33 workflow.py:2167 DEBUG    Workflow version : 0.4.0
15:41:33 workflow.py:1568 DEBUG    Reading settings from `/Users/jklein/Library/Application Support/Alfred 3/Workflow Data/com.cook.quiver/settings.json` ...
15:41:33 workflow.py:2451 DEBUG    Update check not due
15:41:33 workflow.py:1692 DEBUG    Data `library_location` stored in `cpickle` format
15:41:33 workflow.py:1707 DEBUG    Stored data loaded from : /Users/jklein/Library/Application Support/Alfred 3/Workflow Data/com.cook.quiver/library_location.cpickle
15:41:33 workflow.py:2185 ERROR    global name 'db' is not defined
Traceback (most recent call last):
  File "/Users/jklein/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.7849748C-0D50-444B-AAD0-B8E60BB82B12/workflow/workflow.py", line 2178, in run
    func(self)
  File "run.py", line 44, in main
    db.connect()
NameError: global name 'db' is not defined
15:41:33 workflow.py:2205 DEBUG    Workflow finished in 0.063 seconds.
[2018-02-15 15:41:35][ERROR: input.scriptfilter] Code 1: 15:41:34 workflow.py:1692 DEBUG    Data `library_location` stored in `cpickle` format
15:41:34 workflow.py:1707 DEBUG    Stored data loaded from : /Users/jklein/Library/Application Support/Alfred 3/Workflow Data/com.cook.quiver/library_location.cpickle
15:41:34 workflow.py:1803 DEBUG    Loading cached data from : /Users/jklein/Library/Caches/com.runningwithcrayons.Alfred-3/Workflow Data/com.cook.quiver/__workflow_update_status.cpickle
15:41:34 workflow.py:2379 DEBUG    update_data : {u'available': False}
15:41:35 workflow.py:2167 DEBUG    Workflow version : 0.4.0
15:41:35 workflow.py:1568 DEBUG    Reading settings from `/Users/jklein/Library/Application Support/Alfred 3/Workflow Data/com.cook.quiver/settings.json` ...
15:41:35 workflow.py:2451 DEBUG    Update check not due
15:41:35 workflow.py:1692 DEBUG    Data `library_location` stored in `cpickle` format
15:41:35 workflow.py:1707 DEBUG    Stored data loaded from : /Users/jklein/Library/Application Support/Alfred 3/Workflow Data/com.cook.quiver/library_location.cpickle
15:41:35 workflow.py:2185 ERROR    global name 'db' is not defined
Traceback (most recent call last):
  File "/Users/jklein/Library/Application Support/Alfred 3/Alfred.alfredpreferences/workflows/user.workflow.7849748C-0D50-444B-AAD0-B8E60BB82B12/workflow/workflow.py", line 2178, in run
    func(self)
  File "run.py", line 44, in main
    db.connect()
NameError: global name 'db' is not defined
15:41:35 workflow.py:2205 DEBUG    Workflow finished in 0.090 seconds.

kleinjm avatar Feb 15 '18 20:02 kleinjm

Anyone found a way to use nested notebooks with this workflow? Id really like to get this working

AlexanderKvamme avatar Aug 21 '18 09:08 AlexanderKvamme

Been using this as of now: https://github.com/noelcody/quiver-fastsearch-alfred seems this issue has been open for awhile so not sure if this is still being maintained. Some more Quiver Alfred workflows: https://github.com/HappenApps/Quiver/wiki/Extensions

justnealpatel avatar Aug 22 '18 06:08 justnealpatel

@AlexanderKvamme @austinjreilly I do not have a tremendous amount of time to maintain this but I will add it to my to do list. I've removed a try statement that prevented the db from being imported (or throwing an error when imported)... so that should shed some light on what is going on there.

@AlexanderKvamme Is the main issue browsing nested folders?

danielecook avatar Aug 22 '18 16:08 danielecook

Also @austinjreilly the workflow you mention is useful but does not offer the ability to browse tags and folders and in fact this workflow provides the same functionality.

danielecook avatar Aug 22 '18 16:08 danielecook

@danielecook I cant say for sure. I was trying to make it work for a while, but ended up succeeding with another workflow (https://github.com/noelcody/quiver-fastsearch-alfred), so I just stuck with that!

Happy to help debug but im new to development so might need some help :)

AlexanderKvamme avatar Aug 27 '18 09:08 AlexanderKvamme