Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

service gives 500 when installing on macOS, start seems to work but doesn't ask for permisions #13

Open
sammcj opened this issue Sep 5, 2024 · 8 comments

Comments

@sammcj
Copy link

sammcj commented Sep 5, 2024

✓ Starting...
 ✓ Ready in 2.2s
(node:78173) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
 ○ Compiling / ...
 ✓ Compiled / in 5s (3527 modules)
 GET / 200 in 5441ms
 ✓ Compiled in 1009ms (1759 modules)
 ○ Compiling /api/tags ...
 ✓ Compiled /api/tags in 3s (3514 modules)
 GET / 200 in 601ms
 GET /favicon.ico 200 in 17ms
 GET /api/tags 200 in 4ms
✓ Compiled /api/install-service in 244ms (1792 modules)
 GET /api/install-service 500 in 30957ms

But - when I click 'start service' I do notice a new icon in the system tray, when I click it - it has two "quit" options and no other information:

image

It hasn't prompted me to allow it to screen record etc... so I don't think it's actually working.

@sammcj
Copy link
Author

sammcj commented Sep 5, 2024

Ooo somehow I have lots of new tray icons now!

image

@sammcj
Copy link
Author

sammcj commented Sep 5, 2024

and asking any questions with any of my ollama models seems to fail:

image

 ✓ Starting...
 ✓ Ready in 1170ms
 ○ Compiling / ...
 ✓ Compiled / in 2.2s (3518 modules)
 GET / 200 in 2595ms
 ✓ Compiled in 392ms (1759 modules)
 ○ Compiling /api/tags ...
 ✓ Compiled /api/tags in 715ms (3514 modules)
 GET /api/tags 200 in 443ms
 GET /api/tags 200 in 442ms
 GET /favicon.ico 200 in 1094ms
 GET / 200 in 28ms
 ✓ Compiled /api/chat in 334ms (134 modules)
Error: [TypeError: fetch failed] { cause: [Error: AggregateError] }
 POST /api/chat 500 in 408ms
 ✓ Compiled /api/start-service in 287ms (1796 modules)
Error: [TypeError: fetch failed] { cause: [Error: AggregateError] }
 POST /api/chat 500 in 20ms
 GET / 200 in 78ms
Error: [TypeError: fetch failed] { cause: [Error: AggregateError] }
 POST /api/chat 500 in 8ms
 GET / 200 in 21ms

@lucacri
Copy link

lucacri commented Sep 5, 2024

Same problems here:

 ✓ Starting...
 ✓ Ready in 5.4s
(node:65920) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
 ○ Compiling / ...
 ✓ Compiled / in 5.6s (3528 modules)
 GET / 200 in 6034ms
 ✓ Compiled in 532ms (1760 modules)
 ○ Compiling /api/tags ...
 ✓ Compiled /api/tags in 1955ms (1763 modules)
 GET /api/tags 200 in 1999ms
 GET /api/tags 200 in 1999ms
 ✓ Compiled /api/start-service in 309ms (1792 modules)
 GET / 200 in 226ms
 ✓ Compiled /api/chat in 438ms (134 modules)
Server response: {"message":"An error occurred while processing the query.","status":"error"}

Error: [Error: HTTP error! status: 500, message: {"message":"An error occurred while processing the query.","status":"error"}
]
 POST /api/chat 500 in 585ms

@DonTizi
Copy link
Owner

DonTizi commented Sep 5, 2024

Hey @lucacri,

Can you run this command in the terminal when the services are on?

curl -X POST http://localhost:8005/query \
     -H "Content-Type: application/json" \
     -d '{"query": "hey!"}
Let me know what it tells you.

And @sammcj, could you go to /users/{your username}/library/Application support/RemindEnchanted and check if you have any screenshots in the screenshots folder? I need to confirm this first.

Also, the quit feature in the icon works for the service in the repo. I arranged it so that it closes everything when we click on it. i'll upload the repo soon. I will also make sure that when we click on "Start Service", if a service is already running, it doesn't start another one. Thanks for letting me know!

For now to close everything , go to the activity monitor , and close all pythons and remindOCR process.

@lucacri
Copy link

lucacri commented Sep 5, 2024 via email

@sammcj
Copy link
Author

sammcj commented Sep 5, 2024

Just checked mine as well, yes there's screenshots but they're very low resolution 4:3 of a single monitor so I'm not sure if they'd actually be useful.

I had a look through the code and saw this: https://github.com/DonTizi/ReMind/blob/main/installer.py#L10 😬, I'd suggest moving to using standard launchd jobs to register, start and stop the background service so that it's managed in a standard, repeatable way in the same place as all other background services.

For example, my Ollama launchd job:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>AssociatedBundleIdentifiers</key>
	<string>com.electron.ollama</string>
	<key>Disabled</key>
	<false/>
	<key>EnvironmentVariables</key>
	<dict>
		<key>OLLAMA_CACHE_TYPE_K</key>
		<string>q8_0</string>
		<key>OLLAMA_CACHE_TYPE_V</key>
		<string>q8_0</string>
		<key>OLLAMA_FLASH_ATTENTION</key>
		<string>1</string>
		<key>OLLAMA_KEEP_ALIVE</key>
		<string>6h</string>
		<key>OLLAMA_MAX_LOADED_MODELS</key>
		<string>3</string>
		<key>OLLAMA_ORIGINS</key>
		<string>'http://localhost:*,https://localhost:*,app://obsidian.md*,app://*'</string>
	</dict>
	<key>KeepAlive</key>
	<false/>
	<key>Label</key>
	<string>ollama.set.envs.on.boot</string>
	<key>ProgramArguments</key>
	<array>
		<string>/opt/homebrew/bin/bash</string>
		<string>-c</string>
		<string>(open -a /Applications/Ollama.app; sudo /usr/sbin/sysctl iogpu.wired_limit_mb=84000)</string>
	</array>
	<key>RunAtLoad</key>
	<true/>
	<key>WatchPaths</key>
	<array>
		<string>/Applications/Ollama.app</string>
	</array>
</dict>
</plist>
 curl -X POST http://localhost:8005/query -H "Content-Type: application/json" -d '{"query": "hey!"}
Let me know what it tells you.'
curl: (7) Failed to connect to localhost port 8005 after 0 ms: Couldn't connect to server

@kjarnot
Copy link

kjarnot commented Sep 10, 2024

Having the same issue with /api/chat throwing Error: [TypeError: fetch failed] { cause: [Error: AggregateError] }.

@DonTizi - what is supposed to be listening on port 8005?

@Saidshire21
Copy link

y

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants