karlicoss / promnesia

Another piece of your extended mind
https://beepb00p.xyz/promnesia.html
MIT License
1.76k stars 76 forks source link

After installation of firefox app, "eye" not visible and other problems. #241

Open HalMorris opened 3 years ago

HalMorris commented 3 years ago

LATEST (YOU MIGHT WANT TO KNOW BEFORE READING THIS). PROBLEMS OCCURRED ON UBUNTU 20.10, AN INTERIM RELEASE. ON MY 20.4 SYSTEM THINGS SEEMED TO GO BETTER.

TL;DR Current status all went OK up to "promnesia index", which failed (see below). For now, ignore everything below that. Later I may want to know why it failed on ubuntu 20.10, but then again I may first try upgrading 20.10 to the latest LTS.

THE ERROR WAS: FileNotFoundError: [Errno 2] No such file or directory: '/data/promnesia'

FIXED VIA sudo mkdir /data/promnesia; chown hal:hal /data/promnesia

But now getting No module named 'instapexport'. Same thing with pockexport when I comment out refs in config to instapaper.

I find these modules mentioned in : https://releaseeye.info/karlicoss/HPI

I was puzzled by result of "promnesia demo https://github.com/karlicoss/exobrain"

On localhost:13131, I got a largish JSON structure which could also be viewed as "headers" yielding: (Maybe this is just part of setup and not supposed to look like anything?)

<div class="netHeadersGroup">
Date | Fri, 21 May 2021 16:02:01 GMT
-- | --
Server | WSGIServer/0.2 CPython/3.8.5
content-length | 3254
content-type | application/json; charset=utf-8

</div><div class="netHeadersGroup"></div>
Accept | text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
-- | --
Accept-Encoding | gzip, deflate
Accept-Language | en-US,en;q=0.5
Connection | keep-alive
Host | localhost:13131
Upgrade-Insecure-Requests | 1
User-Agent | Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:88.0) Gecko/20100101 Firefox/88.0

I went, as directed, to reddit.com, did ctrl/alt/E and got a reasonable looking sidebar.

I ran promnesia doctor config and got

.config/promnesia/config.py:30: error: Module 'promnesia.sources' has no attribute 'signal'  [attr-defined]
    from promnesia.sources import (
    ^
Found 1 error in 1 file (checked 1 source file)
[INFO    2021-05-21 12:27:29 promnesia __main__.py:240] Checking runtime errors...
[DEBUG   2021-05-21 12:27:29 promnesia __main__.py:213] /usr/bin/python3 /home/hal/.config/promnesia/config.py
[DEBUG   2021-05-21 12:27:30 promnesia __init__.py:801] [promnesia.sources.takeout:read_google_activity] using inferred type <class 'promnesia.common.Visit'>
[DEBUG   2021-05-21 12:27:30 promnesia __init__.py:801] [promnesia.sources.takeout:read_search_activity] using inferred type <class 'promnesia.common.Visit'>
[DEBUG   2021-05-21 12:27:30 promnesia __init__.py:801] [promnesia.sources.takeout:read_browser_history_json] using inferred type <class 'promnesia.common.Visit'>
Traceback (most recent call last):
  File "/home/hal/.config/promnesia/config.py", line 30, in <module>
    from promnesia.sources import (
ImportError: cannot import name 'signal' from 'promnesia.sources' (unknown location)
[ERROR   2021-05-21 12:27:30 promnesia __main__.py:203] CHECK FAILED

Commented out references to "signal" and "doctor" says all OK.

Now, however, promnesia index yields:

$ promnesia index
[INFO    2021-05-21 12:34:22 promnesia __main__.py:375] CLI args: Namespace(config=PosixPath('/home/hal/.config/promnesia/config.py'), dry=False, intermediate=None, mode='index', overwrite=False, sources=None)
[DEBUG   2021-05-21 12:34:22 promnesia __init__.py:801] [promnesia.sources.takeout:read_google_activity] using inferred type <class 'promnesia.common.Visit'>
[DEBUG   2021-05-21 12:34:22 promnesia __init__.py:801] [promnesia.sources.takeout:read_search_activity] using inferred type <class 'promnesia.common.Visit'>
[DEBUG   2021-05-21 12:34:22 promnesia __init__.py:801] [promnesia.sources.takeout:read_browser_history_json] using inferred type <class 'promnesia.common.Visit'>
Traceback (most recent call last):
  File "/usr/lib/python3.8/pathlib.py", line 1284, in mkdir
    self._accessor.mkdir(self, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/data/promnesia'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/hal/.local/bin/promnesia", line 8, in <module>
    sys.exit(main())
  File "/home/hal/.local/lib/python3.8/site-packages/promnesia/__main__.py", line 383, in main
    do_index(
  File "/home/hal/.local/lib/python3.8/site-packages/promnesia/__main__.py", line 95, in do_index
    errors = list(_do_index(dry=dry, sources_subset=sources_subset, overwrite_db=overwrite_db))
  File "/home/hal/.local/lib/python3.8/site-packages/promnesia/__main__.py", line 80, in _do_index
    dump_errors = visits_to_sqlite(it(), overwrite_db=overwrite_db)
  File "/home/hal/.local/lib/python3.8/site-packages/promnesia/dump.py", line 28, in visits_to_sqlite
    db_path = config.get().db
  File "/home/hal/.local/lib/python3.8/site-packages/promnesia/config.py", line 82, in db
    return self.output_dir / 'promnesia.sqlite'
  File "/home/hal/.local/lib/python3.8/site-packages/promnesia/config.py", line 77, in output_dir
    opath.mkdir(exist_ok=True, parents=True)
  File "/usr/lib/python3.8/pathlib.py", line 1288, in mkdir
    self.parent.mkdir(parents=True, exist_ok=True)
  File "/usr/lib/python3.8/pathlib.py", line 1284, in mkdir
    self._accessor.mkdir(self, mode)
PermissionError: [Errno 13] Permission denied: '/data'

################################################################################# The following concerns my attempt to install on a ubuntu 20.10 (non-LTS) laptop which failed I've installed the firefox app, and "addons and themes" shows it as installed, BUT IT IS NOT VISIBLE

I tried to make it work a while ago but gave up after a while, however now it is more important; I'm trying to do full-blown PKM along the lines of "Building a Second Brain" and using Roam, and this is a big missing piece, which I would highly recommend to the forum of the BASB cohort I'm taking (1000+ enrolled), so I'll

I think I've installed everything, but when I try: promnesia demo https://github.com/karlicoss/exobrain

I get, first "No module named "orgparse" "No module named magic"

Then after a lot of other output:

[DEBUG   2021-05-21 07:51:49 promnesia auto.py:290] indexing via _org: /tmp/tmpsme9a1ampromnesia/httpsgithub.comkarlicossexobrain/sitemap.org
[INFO    2021-05-21 07:51:49 promnesia extract.py:82] extracting via promnesia.sources.guess:index ('https://github.com/karlicoss/exobrain',) {} ...: got 5817 visits
[INFO    2021-05-21 07:51:49 promnesia dump.py:93] updated database "/tmp/tmpd5b84iza/promnesia.sqlite". 5821 total (5817 OK, 4 ERRORS)
[ERROR   2021-05-21 07:51:49 promnesia __main__.py:156] 4 errors during indexing (see logs above for backtraces)
[ERROR   2021-05-21 07:51:49 promnesia __main__.py:158] ('While indexing /tmp/tmpsme9a1ampromnesia/httpsgithub.comkarlicossexobrain/android/android-misc.org', "No module named 'orgparse'")
[ERROR   2021-05-21 07:51:49 promnesia __main__.py:158] ('While indexing /tmp/tmpsme9a1ampromnesia/httpsgithub.comkarlicossexobrain/logseq/config.edn', 'No extractor for suffix .edn, mime None')
[ERROR   2021-05-21 07:51:49 promnesia __main__.py:158] ('While indexing /tmp/tmpsme9a1ampromnesia/httpsgithub.comkarlicossexobrain/logseq/metadata.edn', 'No extractor for suffix .edn, mime None')
[ERROR   2021-05-21 07:51:49 promnesia __main__.py:158] ('While indexing /tmp/tmpsme9a1ampromnesia/httpsgithub.comkarlicossexobrain/LICENSE', 'No extractor for suffix , mime None')
[INFO    2021-05-21 07:51:49 promnesia.server server.py:404] Running hug with ServerConfig(db=PosixPath('/tmp/tmpd5b84iza/promnesia.sqlite'), timezone=<DstTzInfo 'America/New_York' LMT-1 day, 19:04:00 STD>)

/#######################################################################\
          `.----``..-------..``.----.
         :/:::::--:---------:--::::://.
        .+::::----##/-/oo+:-##----:::://
        `//::-------/oosoo-------::://.       ##    ##  ##    ##    #####
          .-:------./++o/o-.------::-`   ```  ##    ##  ##    ##  ##
             `----.-./+o+:..----.     `.:///. ########  ##    ## ##
   ```        `----.-::::::------  `.-:::://. ##    ##  ##    ## ##   ####
  ://::--.``` -:``...-----...` `:--::::::-.`  ##    ##  ##   ##   ##    ##
  :/:::::::::-:-     `````      .:::::-.`     ##    ##    ####     ######
   ``.--:::::::.                .:::.`
         ``..::.                .::         EMBRACE THE APIs OF THE FUTURE
             ::-                .:-
             -::`               ::-                   VERSION 2.6.1
             `::-              -::`
              -::-`           -::-
\########################################################################/

 Copyright (C) 2016 Timothy Edmund Crosley
 Under the MIT License

Traceback (most recent call last):
  File "/usr/local/bin/promnesia", line 8, in <module>
    sys.exit(main())
  File "/home/hal/.local/lib/python3.8/site-packages/promnesia/__main__.py", line 394, in main
    do_demo(
  File "/home/hal/.local/lib/python3.8/site-packages/promnesia/__main__.py", line 165, in do_demo
    server._run(
  File "/home/hal/.local/lib/python3.8/site-packages/promnesia/server.py", line 408, in _run
    hug.development_runner.hug(
  File "/home/hal/.local/lib/python3.8/site-packages/hug/development_runner.py", line 91, in hug
    _start_api(
  File "/home/hal/.local/lib/python3.8/site-packages/hug/development_runner.py", line 42, in _start_api
    API(api_module).http.serve(host, port, no_404_documentation, show_intro)
  File "/home/hal/.local/lib/python3.8/site-packages/hug/api.py", line 282, in serve
    httpd = make_server(host, port, api)
  File "/usr/lib/python3.8/wsgiref/simple_server.py", line 154, in make_server
    server = server_class((host, port), handler_class)
  File "/usr/lib/python3.8/socketserver.py", line 452, in __init__
    self.server_bind()
  File "/usr/lib/python3.8/wsgiref/simple_server.py", line 50, in server_bind
    HTTPServer.server_bind(self)
  File "/usr/lib/python3.8/http/server.py", line 138, in server_bind
    socketserver.TCPServer.server_bind(self)
  File "/usr/lib/python3.8/socketserver.py", line 466, in server_bind
    self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use
HalMorris commented 3 years ago

Some additional info. First, I'm running on Linux 20.10. Installed the extension on Chrome as well; couldn't find any sign that that was working. Also I'm not sure what to do with the information "Serving on 13131. When open localhost:13131 I get something like:

<div class="toolbar"><div class="devtools-separator"></div><input class="searchBox devtools-filterinput" placeholder="Filter JSON"></div><div class="panelContent">
&nbsp; | &nbsp;
-- | --
404 | "The API call you tried to make was not defined. Here's a definition of the API to help you get going :)"
documentation | &nbsp;
handlers | &nbsp;
/status | &nbsp;
POST | &nbsp;
usage | "\n    Ideally, status will always respond, regardless the internal state of the backend?\n    "
examples | &nbsp;
0 | "http://localhost/status"
outputs | &nbsp;
format | "JSON (Javascript Serialized Object Notation)"
content_type | "application/json; charset=utf-8"
GET | &nbsp;
usage | "\n    Ideally, status will always respond, regardless the internal state of the backend?\n    "
examples | &nbsp;
0 | "http://localhost/status"
outputs | &nbsp;
format | "JSON (Javascript Serialized Object Notation)"
content_type | "application/json; charset=utf-8"
/visits | &nbsp;
POST | &nbsp;
outputs | &nbsp;
format | "JSON (Javascript Serialized Object Notation)"
content_type | "application/json; charset=utf-8"
inputs | &nbsp;
url | &nbsp;
type | "Basic text / string value"
/search | &nbsp;

</div>
``` (Lots of formatting lost or mangled).

Finally I try promnesia demo and get:

$ promnesia demo [INFO 2021-05-21 09:30:44 promnesia main.py:375] CLI args: Namespace(as='guess', config=None, dry=False, mode='demo', name='demo', overwrite=False, params=[], port='13131', sources=None) [INFO 2021-05-21 09:30:44 promnesia extract.py:49] extracting via promnesia.sources.guess:index () {} ... ... [ERROR 2021-05-21 09:30:44 promnesia extract.py:55] index() missing 1 required positional argument: 'path' Traceback (most recent call last): File "/home/hal/.local/lib/python3.8/site-packages/promnesia/extract.py", line 52, in extract_visits vit: Results = extr() File "/home/hal/.local/lib/python3.8/site-packages/promnesia/extract.py", line 43, in extr = lambda: ex.ff(*ex.args, **ex.kwargs) TypeError: index() missing 1 required positional argument: 'path' [INFO 2021-05-21 09:30:44 promnesia dump.py:93] updated database "/tmp/tmph606na_o/promnesia.sqlite". 1 total (0 OK, 1 ERRORS) [ERROR 2021-05-21 09:30:44 promnesia main.py:156] 1 errors during indexing (see logs above for backtraces) [ERROR 2021-05-21 09:30:44 promnesia main.py:158] index() missing 1 required positional argument: 'path' [INFO 2021-05-21 09:30:44 promnesia.server server.py:404] Running hug with ServerConfig(db=PosixPath('/tmp/tmph606na_o/promnesia.sqlite'), timezone=<DstTzInfo 'America/New_York' LMT-1 day, 19:04:00 STD>)

/#######################################################################\ .----``..-------..``.----. :/:::::--:---------:--::::://. .+::::----##/-/oo+:-##----::::// //::-------/oosoo-------::://. ## ## ## ## ##### .-:------./++o/o-.------::-``` ## ## ## ## ## ----.-./+o+:..----. .:///. ######## ## ## ## ```----.-::::::------ .-:::://. ## ## ## ## ## #### ://::--.``` -:``...-----... :--::::::-. ## ## ## ## ## ## :/:::::::::-:- ``` .:::::-.` ## ## #### ###### .--:::::::. .:::. ``..::. .:: EMBRACE THE APIs OF THE FUTURE ::- .:- -:: ::- VERSION 2.6.1 ::- -:: -::-` -::- ########################################################################/

Copyright (C) 2016 Timothy Edmund Crosley Under the MIT License

Serving on :13131...

HalMorris commented 3 years ago

Did NEW install on UBUNTU 20.4 system (LTS. Previously using 20.10, and interim release)

RESULTS: No Error messages

ON LOCALHOST:13131 (I'm not sure what to expect but probably not this) { "404": "The API call you tried to make was not defined. Here's a definition of the API to help you get going :)", "documentation": { "handlers": { "/status": { "POST": { "usage": "\n Ideally, status will always respond, regardless the internal state of the backend?\n ", "examples": [ "http://localhost/status" ], "outputs": { "format": "JSON (Javascript Serialized Object Notation)", "content_type": "application/json; charset=utf-8" } }, "GET": { "usage": "\n Ideally, status will always respond, regardless the internal state of the backend?\n ", "examples": [ "http://localhost/status" ], "outputs": { "format": "JSON (Javascript Serialized Object Notation)", "content_type": "application/json; charset=utf-8" } } }, "/visits": { "POST": { "outputs": { "format": "JSON (Javascript Serialized Object Notation)", "content_type": "application/json; charset=utf-8" }, "inputs": { "url": { "type": "Basic text / string value" } } } }, "/search": { "POST": { "outputs": { "format": "JSON (Javascript Serialized Object Notation)", "content_type": "application/json; charset=utf-8" }, "inputs": { "url": { "type": "Basic text / string value" } } } }, "/search_around": { "POST": { "outputs": { "format": "JSON (Javascript Serialized Object Notation)", "content_type": "application/json; charset=utf-8" }, "inputs": { "timestamp": { "type": "A whole number" } } } }, "/visited": { "POST": { "outputs": { "format": "JSON (Javascript Serialized Object Notation)", "content_type": "application/json; charset=utf-8" }, "inputs": { "urls": { "type": "Basic text / string value" }, "client_version": { "type": "String", "default": "" } } } } } } }