Git Product home page Git Product logo

Comments (9)

imtbl avatar imtbl commented on July 25, 2024

Hello,

did you remember to run database migrations before starting the server?

user@local:hyve/services/server$ yarn migrate

You will also need to run a sync before the API will start working:

user@local:hyve/services/sync-<client or server>$ yarn sync

This is also mentioned here: https://github.com/mserajnik/hyve#running-without-docker

The fact that /api doesn't return an error but all the other routes do indicates that hyve has issues accessing the data/tables it's expecting.

If that doesn't fix it, could you please open services/server/app.js and comment out this app.use() block: https://github.com/mserajnik/hyve/blob/66886b53872571833ec2f728a35faa64da0ffa08/services/server/app.js#L97-L110

This should make it so it should display exceptions in the console when you hit the API and encounter an error. Please provide me with that error message then. Sorry, there's currently no configuration to set this.

from hyve.

HalidBalid avatar HalidBalid commented on July 25, 2024

Thanks for the quick response. I did run both migration and sync beforehand and they both seemed to successfully complete but there does seem to be something wrong with the database.

SqliteError: no such table: tags
    at Object.getTotalCount (/Users/Anon/hyve/services/server/src/repositories/tags.js:173:23)
    at Object.getTotalTagCount (/Users/Anon/hyve/services/server/src/controllers/tags.js:31:17)
    at /Users/Anon/hyve/services/server/src/routes/info.js:16:40
    at Layer.handle [as handle_request] (/Users/Anon/hyve/services/server/node_modules/express/lib/router/layer.js:95:5)
    at next (/Users/Anon/hyve/services/server/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/Users/Anon/hyve/services/server/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/Users/Anon/hyve/services/server/node_modules/express/lib/router/layer.js:95:5)
    at /Users/Anon/hyve/services/server/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/Users/Anon/hyve/services/server/node_modules/express/lib/router/index.js:335:12)
    at next (/Users/Anon/hyve/services/server/node_modules/express/lib/router/index.js:275:10)
SqliteError: no such table: tags
    at Object.getMostUsed (/Users/Anon/hyve/services/server/src/repositories/tags.js:153:28)
    at Object.getMostUsedTags (/Users/Anon/hyve/services/server/src/controllers/tags.js:25:17)
    at /Users/Anon/hyve/services/server/src/routes/most-used-tags.js:16:31
    at Layer.handle [as handle_request] (/Users/Anon/hyve/services/server/node_modules/express/lib/router/layer.js:95:5)
    at next (/Users/Anon/hyve/services/server/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/Users/Anon/hyve/services/server/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/Users/Anon/hyve/services/server/node_modules/express/lib/router/layer.js:95:5)
    at /Users/Anon/hyve/services/server/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/Users/Anon/hyve/services/server/node_modules/express/lib/router/index.js:335:12)
    at next (/Users/Anon/hyve/services/server/node_modules/express/lib/router/index.js:275:10)
GET /api/namespaces 500 1.889 ms - 1292
SqliteError: no such table: namespaces
    at Object.getNamespaces (/Users/Anon/hyve/services/server/src/repositories/tags.js:168:23)
    at Object.getNamespaces (/Users/Anon/hyve/services/server/src/controllers/tags.js:28:17)
    at /Users/Anon/hyve/services/server/src/routes/namespaces.js:16:42
    at Layer.handle [as handle_request] (/Users/Anon/hyve/services/server/node_modules/express/lib/router/layer.js:95:5)
    at next (/Users/Anon/hyve/services/server/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/Users/Anon/hyve/services/server/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/Users/Anon/hyve/services/server/node_modules/express/lib/router/layer.js:95:5)
    at /Users/Anon/hyve/services/server/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/Users/Anon/hyve/services/server/node_modules/express/lib/router/index.js:335:12)
    at next (/Users/Anon/hyve/services/server/node_modules/express/lib/router/index.js:275:10)
GET /api/mime-types 500 1.132 ms - 1292
SqliteError: no such table: mime_types
    at Object.getMimeTypes (/Users/Anon/hyve/services/server/src/repositories/files.js:796:23)
    at Object.getMimeTypes (/Users/Anon/hyve/services/server/src/controllers/files.js:43:18)
    at /Users/Anon/hyve/services/server/src/routes/mime-types.js:16:42
    at Layer.handle [as handle_request] (/Users/Anon/hyve/services/server/node_modules/express/lib/router/layer.js:95:5)
    at next (/Users/Anon/hyve/services/server/node_modules/express/lib/router/route.js:137:13)
    at Route.dispatch (/Users/Anon/hyve/services/server/node_modules/express/lib/router/route.js:112:3)
    at Layer.handle [as handle_request] (/Users/Anon/hyve/services/server/node_modules/express/lib/router/layer.js:95:5)
    at /Users/Anon/hyve/services/server/node_modules/express/lib/router/index.js:281:22
    at Function.process_params (/Users/Anon/hyve/services/server/node_modules/express/lib/router/index.js:335:12)
    at next (/Users/Anon/hyve/services/server/node_modules/express/lib/router/index.js:275:10)

from hyve.

imtbl avatar imtbl commented on July 25, 2024

In that case it looks like the sync didn't go through successfully. Are you trying to sync from the client or server database? Could you try running it again and take a look at the output of the sync? It should tell you how many files, tags and namespaces it synced at the end.

from hyve.

imtbl avatar imtbl commented on July 25, 2024

Also make sure hyve server is actually connecting to the correct content.db (the same that you used for the sync).

from hyve.

HalidBalid avatar HalidBalid commented on July 25, 2024

I'm trying to sync from the client database. Here's what I get when running yarn sync in sync-client:

yarn run v1.19.1
$ node ./bin/sync
30/10/2019, 12:08:40: Running sync…

Create initial tables (if necessary): 0.002s
Drop zombie tables: 0.000s
Attach hydrus databases: 0.001s
Get services: 0.000s
Get namespaces: 0.008s
Create new tables: 0.004s
Fill new namespaces table: 0.000s
Fill new tags table: 0.004s
Fill new files table: 0.181s
Fill new mappings table: 0.004s
Fill new MIME types table: 0.001s
Update tag counts on new files table: 0.006s
Detach hydrus databases: 0.003s
Replace current tables: 0.035s
Clean up: 0.041s
Total: 0.312s

Namespaces: 0, Tags: 0, Files: 17163, Mappings: 0
✨  Done in 0.45s.

from hyve.

imtbl avatar imtbl commented on July 25, 2024

Hm, that looks correct. At least if you currently don't have any tags? hyve automatically tries to get tags from the first tag service that it finds (so if you are using multiple and have your tags on later services, this wouldn't work right now).

And you are sure the path to the content.db is the same for the sync and the server?

In this case, I'm a bit out of ideas, but would suggest you try to open the content.db with a SQLite client (like https://sqlitebrowser.org/) and see if those tables actually exist.

It should look like this for a working database:

image

from hyve.

HalidBalid avatar HalidBalid commented on July 25, 2024

Ah! I had HYVE_CONTENT_DB_PATH set to /Users/Anon/hyve/data/content.db, when I point it to /Users/Anon/hyve/services/server/storage/content.db instead I now no longer get the API errors and see the files but I still don't seem to have tags. I haven't done any tagging myself yet, just from the public tag repository. So if my local tag service is empty that's why I'm not seeing tags in hyve? Should I try migrating tags into my local service?

Again, thanks for the quick responses and your patience.

from hyve.

imtbl avatar imtbl commented on July 25, 2024

Glad you figured it out! Sorry, it's not the easiest to get running since you basically have to duplicate some configuration across the different services. Ideally, I'd want to have one central location for configuration; I might do something about this in the future.

I haven't done any tagging myself yet, just from the public tag repository. So if my local tag service is empty that's why I'm not seeing tags in hyve?

Yes, that's likely the case. I implemented the client sync shortly before the ability to have multiple tag repositories was introduced into hydrus and haven't touched it since then. I guess hydrus might not add those tags you get from the PTR automatically to the local my tags service (which hyve is trying to pull the tags from).

I should also make this configurable, although there's the issue that it's quite a hassle for the user to figure out which service ID is the correct one. Hence the automatic choice for the client sync at the moment; the server sync requires manual configuration, but the IDs are more predictable there and running the server is more technically advanced, which is why I don't feel too bad about having the user configure it manually there.

from hyve.

HalidBalid avatar HalidBalid commented on July 25, 2024

No worries! I'll look into tag migration to shove everything into my local tag service (after backing it all up), which would be good enough for me right now. Cheers!

from hyve.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.