Skip to main content
Inspiring
August 24, 2018

P: Sync Yields "bad argument #1 to '?' (number expected, got nil)" Error Messages

  • August 24, 2018
  • 22 replies
  • 725 views

Within the last several weeks, I have started to get errors when trying to sync from LR Classic.  Some problem images have been successfully synced for months, and others are new.  The problems seemed to begin when I removed some photos from All Photos in LR CC.  In the upper left corner, I see "Syncing 3 photos", though the number changes.  In Preferences, Sync Activity, the images have had the message "bad argument #1 to '?' (number expected, got nil)", and the Remove from All Synced Photos option doesn't seem to do anything.
Is there some way I can reset the sync environment?  Would that be a solution? Thanks.

This topic has been closed for replies.

22 replies

Known Participant
October 28, 2018
Discovered yesterday this same error message when deleting images from disk and removing from catalog.  The message appears after LR performs the deletion, but then it fails to remove from catalog.  I have to run the command again, this time selecting only remove.

Sounds like LR is performing some sort of check as to whether it has performed the command and receives a false negative and then stops.  However, in all cases, it actually did the work.
Inspiring
October 28, 2018
I get that too.  I have one stuck and it's been weeks.
sstretchh
Participating Frequently
October 15, 2018
I did this and the errors went away, but there is a delay where everything is stuck on PENDING. Does that normally happen ? 

As of this post, waited around 5 minutes and everything is still stuck on pending
Known Participant
October 10, 2018
I occasionally, but not always, receive the same error message after LR finishes writing xmp data to files after an import and keywording.
Participating Frequently
October 10, 2018
@HannesKa -- we will try reproducing this issue. We will look into it.
Participating Frequently
October 9, 2018


i changed flags in about 300 pictures in lightroom-mobile-android-app to reject.
then i deleted this 300 pictures in lightroom-mobile-android-app.
At the next start of lightroom-classic-cc the sync stopped with this error message:
bad argument #1 to '?' (number expected, got nil).

i tried this: Classic -> Preferences -> Lightroom Sync -> Press alt/option -> Rebuild Sync data -> Lightroom restart -> sync activate -> problem not solved!

I changed the flags

Windows 10, lateste lr-classic-cc
Inspiring
September 24, 2018
It just gets more weird.  I'm trying to handle this methodically.

I started by changing all my sync'd collections to non-synced and removing all photos from the "All Synced Photographs" collection.   I verified this by going to Lightroom Web and seeing no synced colllections as well as a zero count in "All Photos".

Then I slowly started syncing the collections.  No errors, and the count on LR Web matched the count in "All Synced Collections".   Then I synced a collection that contained 12 photos produced with a scanner from old prints and negatives.  That resulted in 5 photos synced (all JPGs) and 7 TIFs with "Sync Pending".   Even after a day, no change.  

What is strange is that the sync status displays within LR are inconsistent.  The upper left hand banner area says "Syncing 7 photos", but the Edit->Preferences->Lightroom Sync says "0 Uploading, 0 Downloading, 0 Pending".  The sync icon in the photos upper right hand corners each say "Sync with Lightroom CC Pending". 

I've tried the "Rebuild Sync Data" button with and without removing the sync file.  No change. 

Problematic sync problems (both silently stuck and with "bad argument" errors) have been scans in TIFF format from an older Epson flatbed scanner imported originally into Photoshop Elements 8.   But most such photos sync fine.  

Llightroom Classic up to date (7,.5) with the Photography Plan subscription.
Inspiring
September 22, 2018
OK, with the help of some old John Ellis' posts, I learned that the Library "Date" filter (and probably Sort) key off EXIF "Date Time Original" which was blank on most of my scans.    I used Metadata->Set Capture Date to re-set the capture date to the same value and the side effect of that was to set "Date Time Original" to the value of Capture Date. 
That's good for sort orders in library, and will help me organize some collections.   But it didn't do anything for the total number of "stuck syncing" photos.   And the photos with the "bad argument" error still have the error even though "Date Time Original" is now a valid number and not nil.  Sigh.
Inspiring
September 21, 2018
That may be it, the photos are scans made with an Epson 4870 and imported into Photoshop Elements originally, so dates may be wonky.

But I can't figure out how it applies specifically.  When I locate the image with the "bad argument" error, Metadata->Edit Capture Time shows a valid date time as original.  EXIF "DateTime" in the rigtht hand panel shows the same date/time."Metadata Date" is valid.  IPTC "Date Created" is blank, but that's also true of a lot of photos originating from a digital camera.

Despite all those dates, the photo does show up when I apply the Library module Metadata "Date" filter with value "Unknown".   Is that keying off a hidden field?  I just don't understand what that filter is looking at.
Participating Frequently
September 21, 2018
Akshay, do you agree that ther is a bug in LR?

I had the same problem and solved the issue:
i searched/filtered all photos in the sync-collection which have no "date"-entry (but only in a "hidden" field that is used for one filter).
in the right panel in lr-classic-cc there is a field "capture time" that is filled, you can't see the empty field in the right metadata panel in LR.

i filled the field with a date/time, then the photos were synced

the workaround is from an other user (tpnotes) who filtered and deleted this photos from the synced-collection.

see here:
https://feedback.photoshop.com/photoshop_family/topics/lr-classic-7-5-sync-yields-bad-argument-1-to-...