grokability / jamf2snipe

Import and sync assets from a JAMFPro instance to Snipe-IT asset management.
MIT License
113 stars 55 forks source link

500 Error, while running script #123

Closed kMikaZu closed 10 months ago

kMikaZu commented 11 months ago

I've setup a Jamf staging environment and I'm setting up a Snipe-IT sync. All works fine, except for the latest stage of the script. Then there is an error. I ran the scrip with the --debug option and this is the error:

DEBUG:urllib3.connectionpool:Starting new HTTPS connection (1): <url>:443
DEBUG:urllib3.connectionpool:<url>:443 "POST /api/v1/hardware HTTP/1.1" 500 33
DEBUG:root:{
    "message": "Server Error"
}
ERROR:root:Asset creation failed for asset STAGING_FFMDR110PLJQ with error {
    "message": "Server Error"
}
DEBUG:root:('ERROR', <Response [500]>)
DEBUG:root:Total amount of API calls made: 0

Any ideas?

jerm commented 11 months ago

What do your snipe-it logs in storage/logs/laravel.log say? That should receive the detail for 500 errors you get in the api.

kMikaZu commented 11 months ago

We ran the script again and checked storage/logs/lavarel.log but didn't find anything. Apparently, even nothing gets written to the log when running the script. We use a default Snipe-IT Docker environment.

kMikaZu commented 10 months ago

In Debug-Mode, I get this error:

[2024-01-10 18:11:24] production.ERROR: SQLSTATE[HY000] [2002] Connection refused (SQL: select * fro...

Any ideas? My colleague configured the Docker, based on your instructions. Is that Docker still being maintained and are permissions ok by default?

P.S.: Apparently, it's almost impossible to copy the complete log from the browser...

jerm commented 10 months ago

Do you have snipe-it up and running? like, can you login to the interface and everything? SQL connection refused sounds like a very basic "snipe-it won't work" issue, and not a jamf2snipe issue at all, though it would explain the 500 errors.

Sounds like you need to get your snipe-it installation fixed. Check your database, check your connectivity to the database from the container, check your .env file to make sure it's got good DB configuration.... basic stuff

jerm commented 10 months ago

I'm going to assume the 500 errors that spawned the issue are because of the DB connection issues, and close the issue for now.

If you get the DB stuff sorted and are still getting errors, we can re-open it