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

could not unmarshal json from script output: EOF #1

Closed
nshybrid opened this issue Feb 4, 2025 · 2 comments
Closed

could not unmarshal json from script output: EOF #1

nshybrid opened this issue Feb 4, 2025 · 2 comments

Comments

@nshybrid
Copy link

nshybrid commented Feb 4, 2025

I've set up the database using a docker container for postgres:17.2-bookworm on port 25432. I loaded the data manually using DBeaver and Execute script. I'm able to query the DB using DBeaver and get the right result:

select *
from derived_video dv
where dv.dvd_id = 'JUR-013';

I updated my *.py file to the below (removed my local ip):
conn = psycopg2.connect(database="r18",
host="192.168.x.x",
user="postgres",
password="postgres",
port="25432")

However, when scraping on my stashapp, I get an error saying "could not unmarshal json from script output: EOF". Which leads me to think either the JSON is malformed or there's no response. Any way I can check logs?

Image

@javstash
Copy link
Owner

javstash commented Feb 4, 2025

Yes, check Settings -> Logs, the scraper should print out something like this

[Scrape / R18dev_SQL] CONTENT ID: jur013 @ %
[Scrape / R18dev_SQL] sceneByName | DVD CODE: JUR-013
[Scrape / R18dev_SQL] DVD CODE: JUR-013  ->  jur013 @ mono
[Scrape / R18dev_SQL] {"name": "JUR-013"} @ sceneByName

@nshybrid
Copy link
Author

nshybrid commented Feb 4, 2025

Posting the resolution here, in case anyone else finds it.
I checked the logs and saw:

ERRO[2025-02-04 18:46:02] [Scrape / R18dev_SQL]   File "/root/.stash/scrapers/custom/R18dev_SQL/R18dev_SQL.py", line 3, in <module> 
ERRO[2025-02-04 18:46:02] [Scrape / R18dev_SQL]     import psycopg2    
ERRO[2025-02-04 18:46:02] [Scrape / R18dev_SQL] ModuleNotFoundError: No module named 'psycopg2' 
ERRO[2025-02-04 18:46:02] could not unmarshal json from script output: EOF 
ERRO[2025-02-04 18:46:02] scrapeSingleScene: input: scrapeSingleScene scraper R18dev_SQL: could not unmarshal json from script output: EOF 
2025-02-04T18:46:02.223771124-05:00 INF Response: 200 OK httpRequest={"proto":"HTTP/1.1","remoteIP":"192.168.0.84:62721","requestID":"0a5c8154a96b/Be1QSLXioh-000011","requestMethod":"POST","requestPath":"/graphql","requestURL":"http://192.168.0.8:6969/graphql"} httpResponse={"bytes":140,"elapsed":27.722826,"status":200} service=stash```

I then ran `pip install psycopg2-binary --break-system-packages` and my issue was resolved!

@nshybrid nshybrid closed this as completed Feb 4, 2025
javstash pushed a commit that referenced this issue Feb 24, 2025
check for wget as it is not preinstalled
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

2 participants