Skip to main content
Jamf Nation, hosted by Jamf, is a knowledgeable community of Apple-focused admins and Jamf users. If you like what you see, join us in person at the ninth annual Jamf Nation User Conference (JNUC) this October for three days of learning, laughter and IT love.

Jamf Pro 10 not mass deleting computers

I'm just testing the Jamf Pro 10 release in the lab and encounter a problem when deleting multiple computers @ once.

to make things a little more visible I enabled SQL statement logging on JSS.

I intend to delete 10 machines @ once by clicking Action --> Delete Computers.

After pressing "Next" on the choose an Action screen all I get is a waiting circle and after some time the Session is timing out. I do see the CPU for "mysqld" increasing but never recovering how long I even wait, nor does my computer count is decreasing by 10.

Also in the JSS log I can not find a single delete statement showing up..

Deleting Computers 1 by one seems to work. Did anyone else encounter this problem ?

Like Comment
Order by:
SOLVED Posted: by dsweigart

I noticed this too when I was attempting to delete more then 2 devices at a time. I ended up just “clicking” on my page every few minutes during the loading screen process and after about 10-15 minutes, I was asked to confirm the deletion.

I tried 50 devices and it kept timing out on me.

Like
SOLVED Posted: by pnbahry

I have also noticed this problem, I will need to remove over 200 machine records and it just times out and mysql is maxing out on CPU usage.

Like
SOLVED Posted: by neil.martin83

Same here.

Like
SOLVED Posted: by ChupSuy

for now as a workaround I have made myself an API script feeding a txt file with Computer names and delete 1 by one via API instead but this must be fixed in the GUI as we have folks out there that frequently purge a large number of machines @ once which will then cause the DB to go down.. :/

I informed support and hope they'll open a PI on that..

Like
SOLVED Posted: by chris.kemp

Yeah, same here - trying to clean up our dev JSS and it's not letting me mass-delete computers.

Like
SOLVED Posted: by arpierson

Seeing the same thing here. fwiw, I upgraded our MySQL to 5.7 today as well. So, I'm running the recommended config according to the Jamf Pro 10 documentation.

Like
SOLVED Posted: by chris.kemp

I found that by bouncing tomcat then mysql recovers. It seems that other things kept functioning, at least to a degree - when I checked our db server it was running at over 400% cpu, which may be due to my having run more than one delete. Soon as I restarted tomcat it went back to normal - and executing another mass delete sent it right back up to around 130% usage, until I bounced tomcat again.

Like
SOLVED Posted: by chris.kemp

Incidentally, we're running RHEL6 and mysql 5.6.

Like
SOLVED Posted: by ChupSuy

by enabling the Statement Debugging I found whenever you intend to delete more than 1 machines its doing insane a lot Select statement.. not sure what these shall be good for as all thats really needed for deleting the machines is the ID's..

That seems to be taking to long and the session is timing out before you even get to the screen Do you really want to delete these machines..

send my logs to the support..

Like
SOLVED Posted: by jkuo

I have not yet tested this on Jamf 10, but I've posted a command line API tool that will delete computer records reading from a CSV file one at a time. Since you're testing in a lab environment, perhaps this might work and save you some time?
https://github.com/eventbrite/Casper-API-Tools

And here's how the command would work:

https://github.com/eventbrite/Casper-API-Tools#delete-computers-by-jss-id-using-a-csv-file

Or you could just delete one at a time and build all the commands in a spreadsheet, but it would at least save you the time of going to each record. It would be a command like:

jamfapi deletecomputerbyid 1234

Where '1234' is the JSS ID of the computer.

Like
SOLVED Posted: by Chris_Hafner

On a test server (and old mac mini) I just deleted 653 computer records without issue. It took some time but it did. Configuration as follows: JSS 10 on macOS 10.12.6 "Server", MySQL 5.7. something... it crashed when I tried to log in to check the exact version. I guess we may still want to avoid 5.7 in favor of 5.6. Yet, this IS a test server so I find it interesting that it did manage to delete all those computer records and then muck itself.

Like
SOLVED Posted: by jwojda

I had it delete 25 users and it went through fine, a little slow, but didn't error out.

Like
SOLVED Posted: by ChupSuy

done some further digging on this and it turns out it all has todo with the historical data a given machine carries around..

Checking my DB tables I found my tables location_history & locations where insane large...

use jamfsoftware; SELECT table_name AS "Tables", Round(( ( data_length + index_length ) / 1024 / 1024 ), 2) "Size in MB" FROM information_schema.tables WHERE table_schema = "jamfsoftware" ORDER BY ( data_length + index_length );

So how to flush these keeping the most recent data only.. This answer I found on another discussion: https://www.jamf.com/jamf-nation/discussions/17908/user-and-location-history-flush-maintenance

Thanks @brunerd who shared his

Journey of a thousand commands

After I had cleared the historical data only keeping the most recent location history suddenly I could delete large counts of machines again..

Wish Jamf could provide a option to regularly flush these historical data tables on demand or on a schedule who we would not have to use direct DB manipulating..

Hope this helps anyone having similar issues..

Like
SOLVED Posted: by arpierson

@ChupSuy, this was the answer! I had 11.9 million rows in location_history and couldn't get anything to delete. Ran the commands on the linked page, got down to approx. 4700 rows, and deleted over 120 machines with no problems!

Like
SOLVED Posted: by rcorbin

We were told there is actually a product issue open for this behavior. PI-004957.

In the mean time I may have to give that flushing historical data a try. Or the API script.

Like
SOLVED Posted: by rcorbin

Has anyone tested @jkuo 's tool in Jamf 10 ? After clearing out tables location_history & locations it is better. I can do 20 at a time and it works. But If I try say 200 it eventually times out.

Like
SOLVED Posted: by jkuo

@rcorbin I've been using it in Jamf 10, but I have not done large batches, only smaller ones (maybe 5 or so at a time).

Like
SOLVED Posted: by Br3ck

@jkuo I just had a go with your deletecomputeridsfromcsv and it worked mostly great but you still have to confirm every deletion with a "y" and return but this is far better than trying to use the JSS web interface to delete one by one. I really cant believe this PI is still not fixed, its a big pain but this CLI was a lifesaver so thank you!

Also wanted to note that the action failed on a few of the objects I was attempting to delete:

Are you sure you want to delete the computer above from the JSS? (y/n): y
Deleting computer 2652...
Successfully deleted computer 2652
Test Run: Delete computer ID 2644
Getting computer with JSS ID 2644...

GENERAL INFORMATION:
Computer Name: SFO-M-PQ217G
Asset Number: None
JSS Computer ID: 2644
Serial Number:
Mac Address:
*
Managed: true
Traceback (most recent call last): File "/Volumes/CasperAPI/CasperAPI_CLI.py", line 1523, in <module> main() File "/Volumes/CasperAPI/CasperAPI_CLI.py", line 1439, in main deleteComputerIDsFromCSV(computersCSV, user, password) File "/Volumes/CasperAPI/CasperAPI_CLI.py", line 1206, in deleteComputerIDsFromCSV deleteComputerByID(compID, username, password) File "/Volumes/CasperAPI/CasperAPI_CLI.py", line 1166, in deleteComputerByID getComputerByID(comp_id, username, password) File "/Volumes/CasperAPI/CasperAPI_CLI.py", line 377, in getComputerByID print 'Last Check-In: ' + last_contact_time
TypeError: cannot concatenate 'str' and 'NoneType' objects

Like
SOLVED Posted: by jkuo

@Br3ck I'm glad it's helping you save at least a little time!

I'm considering making a way to take away the confirmation message (just wanted to be super safe there!) and perhaps displaying a column list of computer information and allowing you to click "Yes" to the whole list. Would that be helpful for you?

I'll fix that bug on the last check in - if the last_contact_time is null, then I need to process the display computer process differently.

Thanks,
Jason

Like
SOLVED Posted: by Br3ck

@jkuo - sorry for the ridiculous delay here, I appreciate the extra check before deleting but yeah i think a mechanism without that would be amazing seeing as how this is still an open PI with jamf.

Like
SOLVED Posted: by CasperSally

Really disappointed PI-004957 isn't fixed in 10.5. Is there a roadmap/time frame for getting this fixed?

Like
SOLVED Posted: by mschroder

Deleting ~260 computers yesterday took about 12 hours, that is really really bad. And yes, the user and location history is completely out of control. An entry every few seconds, and the complete history since the big bang don't go well together.

Like