danielmagnussons / orgmode

orgmode is for keeping notes, maintaining TODO lists, planning projects, and authoring documents with a fast and effective plain-text system.
MIT License
753 stars 70 forks source link

can't find orgmode_store.bin.gz #61

Closed wrigleyster closed 6 years ago

wrigleyster commented 8 years ago

I run Linux w/ sublime text v3099 I get this error message every time I launch Sublime Text since I installed orgmode.

Traceback (most recent call last):
  File "/opt/sublime_text_3/sublime_plugin.py", line 320, in on_deactivated
    callback.on_deactivated(v)
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 41, in on_deactivated
    self.save(view, 'on_deactivated')
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 90, in save
    with GzipFile(self.store, 'wb') as f:
  File "./gzip.py", line 184, in __init__
FileNotFoundError: [Errno 2] No such file or directory: '/opt/sublime_text_3/Settings/orgmode-store.bin.gz'
+ Debug: Invalid language: Plain text. Available: Go, Python3, Ruby, Tcl, RHTML, Python, XBL, Django, XUL, HTML, Perl, SCSS, CSS, Mason, Node.js, Smarty, PHP, HTML5, Twig, Sass, JavaScript, TemplateToolkit, XSLT, XML, Less
Invalid language: Plain text. Available: Go, Python3, Ruby, Tcl, RHTML, Python, XBL, Django, XUL, HTML, Perl, SCSS, CSS, Mason, Node.js, Smarty, PHP, HTML5, Twig, Sass, JavaScript, TemplateToolkit, XSLT, XML, Less
Traceback (most recent call last):
  File "/opt/sublime_text_3/sublime_plugin.py", line 320, in on_deactivated
    callback.on_deactivated(v)
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 41, in on_deactivated
    self.save(view, 'on_deactivated')
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 90, in save
    with GzipFile(self.store, 'wb') as f:
  File "./gzip.py", line 184, in __init__
FileNotFoundError: [Errno 2] No such file or directory: '/opt/sublime_text_3/Settings/orgmode-store.bin.gz'
Traceback (most recent call last):
  File "/opt/sublime_text_3/sublime_plugin.py", line 320, in on_deactivated
    callback.on_deactivated(v)
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 41, in on_deactivated
    self.save(view, 'on_deactivated')
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 90, in save
    with GzipFile(self.store, 'wb') as f:
  File "./gzip.py", line 184, in __init__
FileNotFoundError: [Errno 2] No such file or directory: '/opt/sublime_text_3/Settings/orgmode-store.bin.gz'
Traceback (most recent call last):
  File "/opt/sublime_text_3/sublime_plugin.py", line 320, in on_deactivated
    callback.on_deactivated(v)
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 41, in on_deactivated
    self.save(view, 'on_deactivated')
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 90, in save
    with GzipFile(self.store, 'wb') as f:
  File "./gzip.py", line 184, in __init__
FileNotFoundError: [Errno 2] No such file or directory: '/opt/sublime_text_3/Settings/orgmode-store.bin.gz'
Traceback (most recent call last):
  File "/opt/sublime_text_3/sublime_plugin.py", line 320, in on_deactivated
    callback.on_deactivated(v)
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 41, in on_deactivated
    self.save(view, 'on_deactivated')
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 90, in save
    with GzipFile(self.store, 'wb') as f:
  File "./gzip.py", line 184, in __init__
FileNotFoundError: [Errno 2] No such file or directory: '/opt/sublime_text_3/Settings/orgmode-store.bin.gz'
unable to auto detect encoding for ~/docs/formelsamling/ss/main.pdf, using fallback encoding Western (Windows 1252)
Traceback (most recent call last):
  File "/opt/sublime_text_3/sublime_plugin.py", line 224, in on_pre_close
    callback.on_pre_close(v)
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 47, in on_pre_close
    self.save(view, 'on_pre_close')
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 90, in save
    with GzipFile(self.store, 'wb') as f:
  File "./gzip.py", line 184, in __init__
FileNotFoundError: [Errno 2] No such file or directory: '/opt/sublime_text_3/Settings/orgmode-store.bin.gz'
Traceback (most recent call last):
  File "/opt/sublime_text_3/sublime_plugin.py", line 224, in on_pre_close
    callback.on_pre_close(v)
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 47, in on_pre_close
    self.save(view, 'on_pre_close')
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 90, in save
    with GzipFile(self.store, 'wb') as f:
  File "./gzip.py", line 184, in __init__
FileNotFoundError: [Errno 2] No such file or directory: '/opt/sublime_text_3/Settings/orgmode-store.bin.gz'
unable to auto detect encoding for ~/docs/formelsamling/ss/main.pdf, using fallback encoding Western (Windows 1252)
Traceback (most recent call last):
  File "/opt/sublime_text_3/sublime_plugin.py", line 224, in on_pre_close
    callback.on_pre_close(v)
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 47, in on_pre_close
    self.save(view, 'on_pre_close')
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 90, in save
    with GzipFile(self.store, 'wb') as f:
  File "./gzip.py", line 184, in __init__
FileNotFoundError: [Errno 2] No such file or directory: '/opt/sublime_text_3/Settings/orgmode-store.bin.gz'
Traceback (most recent call last):
  File "/opt/sublime_text_3/sublime_plugin.py", line 224, in on_pre_close
    callback.on_pre_close(v)
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 47, in on_pre_close
    self.save(view, 'on_pre_close')
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 90, in save
    with GzipFile(self.store, 'wb') as f:
  File "./gzip.py", line 184, in __init__
FileNotFoundError: [Errno 2] No such file or directory: '/opt/sublime_text_3/Settings/orgmode-store.bin.gz'
unable to auto detect encoding for ~/docs/formelsamling/ss/main.pdf, using fallback encoding Western (Windows 1252)
Traceback (most recent call last):
  File "/opt/sublime_text_3/sublime_plugin.py", line 224, in on_pre_close
    callback.on_pre_close(v)
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 47, in on_pre_close
    self.save(view, 'on_pre_close')
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 90, in save
    with GzipFile(self.store, 'wb') as f:
  File "./gzip.py", line 184, in __init__
FileNotFoundError: [Errno 2] No such file or directory: '/opt/sublime_text_3/Settings/orgmode-store.bin.gz'
Traceback (most recent call last):
  File "/opt/sublime_text_3/sublime_plugin.py", line 320, in on_deactivated
    callback.on_deactivated(v)
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 41, in on_deactivated
    self.save(view, 'on_deactivated')
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 90, in save
    with GzipFile(self.store, 'wb') as f:
  File "./gzip.py", line 184, in __init__
FileNotFoundError: [Errno 2] No such file or directory: '/opt/sublime_text_3/Settings/orgmode-store.bin.gz'
Traceback (most recent call last):
  File "/opt/sublime_text_3/sublime_plugin.py", line 320, in on_deactivated
    callback.on_deactivated(v)
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 41, in on_deactivated
    self.save(view, 'on_deactivated')
  File "/home/user/.config/sublime-text-3/Packages/orgmode/orgmode_store.py", line 90, in save
    with GzipFile(self.store, 'wb') as f:
  File "./gzip.py", line 184, in __init__
FileNotFoundError: [Errno 2] No such file or directory: '/opt/sublime_text_3/Settings/orgmode-store.bin.gz'

The gz it is trying to find I believe is located at: /home/user/.config/sublime-text-3/Packages/Settings/orgmode_store.bin.gz

yoyosan commented 8 years ago

To temporarily solve this just copy the file from /home/user/.config/sublime-text-3/Packages/Settings/orgmode_store.bin.gz into /opt/sublime_text_3/Settings/orgmode-store.bin.gz. Also, give it permissions so that the user you're running Sublime with can access it.

LE: If the folder doesn't exist, just do this:

sudo mkdir /opt/sublime-text-3/Settings
sudo touch /opt/sublime-text-3/Settings/orgmode_store.bin.gz
sudo chown user: /opt/sublime-text-3/Settings/orgmode_store.bin.gz

and restart Sublime.

That's all.

ashed commented 6 years ago

This commands as workaround for this bug.

sudo cp ./orgmode-store.bin.gz /opt/sublime_text/Settings/orgmode-store.bin.gz
sudo chown -R user:user_main_group /opt/sublime_text/Settings/orgmode-store.bin.gz

But how about "right" method of this bug correction? Maybe rewrote this piece of code from orgmode_store.py:

def __init__(self, *args, **kwargs):
        self.debug = False
        self.db = {}
        self.store = join(
            abspath(sublime.packages_path()),
            'Settings',
            'orgmode-store.bin.gz')
        try:
            makedirs(dirname(self.store))
        except:
            pass
        try:
            with GzipFile(self.store, 'rb') as f:
                self.db = load(f)
        except:
            self.db = {}

With kind regards.

danielmagnussons commented 6 years ago

Think we got a fix here: fa487b1a493afcaabae4a640671b66170b814fb4

ashed commented 6 years ago

This is really quick and good job. Thank you.