Pomax / flickrmirror

Mirror your Flickr account to your HD. Then write a new site based on it.
17 stars 4 forks source link

Errors displaying Main page #11

Closed glowrocks closed 10 years ago

glowrocks commented 10 years ago

When connecting to my site, www.testbits.org, I get the following error.

I've tried using different versions of node to no avail.

I did once start the server before the downsync had completed, and got a display. I accidently, but fortuitously, left that tab open when I restarted.

I reloaded, and it worked, and continues to work. I can view sets and move along a photo at a time. Just can't view the main index.

Link to page that works, followed by error message from index:

http://www.testbits.org/glowrocks/photos/10220145064

root@riverside-cafe:/usr/local/src/flickrmirror-master# node app
connect.multipart() will be removed in connect 3.0
visit https://github.com/senchalabs/connect/wiki/Connect-3.0 for alternatives
connect.limit() will be removed in connect 3.0
Node server listening on http://127.0.0.1:80
TypeError: Cannot call method 'forEach' of undefined
    at /usr/local/src/flickrmirror-master/routes/index.js:176:28
    at Array.forEach (native)
    at buildCollectionThumbnails (/usr/local/src/flickrmirror-master/routes/index.js:164:37)
    at handler.index (/usr/local/src/flickrmirror-master/routes/index.js:180:8)
    at callbacks (/usr/local/src/flickrmirror-master/node_modules/express/lib/router/index.js:164:37)
    at param (/usr/local/src/flickrmirror-master/node_modules/express/lib/router/index.js:138:11)
    at paramCallback (/usr/local/src/flickrmirror-master/node_modules/express/lib/router/index.js:150:30)
    at handler.parameters.forEach.app.param.res.locals.(anonymous function) (/usr/local/src/flickrmirror-master/routes/index.js:282:9)
    at paramCallback (/usr/local/src/flickrmirror-master/node_modules/express/lib/router/index.js:151:7)
    at param (/usr/local/src/flickrmirror-master/node_modules/express/lib/router/index.js:133:11)
Pomax commented 10 years ago

this goes wrong in the codepath for generating collection thumbnails; do you have any collections?

glowrocks commented 10 years ago

Apparently not as I don't see any on my account and don't recall setting any up.

http://www.flickr.com/photos/glowrocks/

On Wed, Nov 20, 2013 at 9:18 PM, Mike Kamermans notifications@github.comwrote:

this goes wrong in the codepath for generating collection thumbnails; do you have any collections?

— Reply to this email directly or view it on GitHubhttps://github.com/Pomax/flickrmirror/issues/11#issuecomment-28954936 .

Pomax commented 10 years ago

I've updated the code to work with sets when no collections exist - if you update to the latest master (or tag v0.1.10) you should be able to view the main page.

glowrocks commented 10 years ago

Hi,

I did update (at least the package.json file so indicates 0.1.10) but am still not able to display the main page.

Turns out I mis-spoke. I do have collections, ie. nested sets more or less. Sorry about that.

thanks,

Mike

On Wed, Nov 20, 2013 at 9:43 PM, Mike Kamermans notifications@github.comwrote:

I've updated the code to work with sets when no collections exist - if you update to the latest master (or tag v0.1.10) you should be able to view the main page.

— Reply to this email directly or view it on GitHubhttps://github.com/Pomax/flickrmirror/issues/11#issuecomment-28955905 .

Pomax commented 10 years ago

That's quite peculiar. How many collections are in your userdata/yourname/ia/collections dir? Each file should look something like this:

{
  "id": "4234238-72157600271556443",
  "title": "Nature in all its forms",
  "description": "This collection contains all my photographs of nature, wildlife, and not-so-wildlife (such as pets).",
  "iconlarge": "http://farm2.staticflickr.com/1368/cols/72157600271556443_e1d256f95a_l.jpg",
  "iconsmall": "http://farm2.staticflickr.com/1368/cols/72157600271556443_e1d256f95a_s.jpg",
  "set": [
    {
      "id": "72157600282437628",
      "title": "Abkhazi garden",
      "description": "The abkhazi garden was actually someone's garden in the 1940's and has been maintained ever since, see <a href=\"http://www.conservancy.bc.ca/content.asp?sectionack=abkhazi\">www.conservancy.bc.ca/content.asp?sectionack=abkhazi</a> for more information and visit it if you can, it's well worth it ^^"
    },
  ...
    {
      "id": "72157600273331630",
      "title": "UBC botanical garden",
      "description": "In june 2006 I took a trip to the botanical garden at the University of British Columbia, armed with a camera, tripod, and some lenses. This is the result of that little trip."
    }
  ]
}

If there is a set property but it's empty, that might be a possible reason. Can I ask you to check if anything seems irregular in those collection files?

glowrocks commented 10 years ago

I'll check after the downloads complete, but I have a feeling there will be more than before.

Unfortunately, I have little disk space on this 5$ VM, so I had to delete my old copy of images. (hated to do it, but ...)

and it just finished syncing, but w/errors. there are 6 json files in the collections folder. I have 6 sets, so that matches.

I looked at one of the files and there are multiple instances where the property description is not set. so you may be on the right path.

here's the latest downsync error; it could be temporary as I've seen a bunch of those since starting this yesterday evening. figured those are flickr or my isp's fault.

==========================================================================-] 5912/5913 done downloading photo metadata.

Downloading set metadata from Flickr.

[=====================================================================================================================================================================================--------------------------------------------------------------------------------------------] 182/274 TypeError: Cannot read property 'statusCode' of undefined at Request._callback (/usr/local/src/flickrmirror-master/node_modules/flickrapi/src/utils.js:169:43) at self.callback (/usr/local/src/flickrmirror-master/node_modules/flickrapi/node_modules/request/index.js:148:22) at Request.EventEmitter.emit (events.js:95:17) at ClientRequest.self.clientErrorHandler (/usr/local/src/flickrmirror-master/node_modules/flickrapi/node_modules/request/index.js:258:10) at ClientRequest.EventEmitter.emit (events.js:95:17) at Socket.socketOnEnd as onend at Socket.g (events.js:175:14) at Socket.EventEmitter.emit (events.js:117:20) at _stream_readable.js:920:16 at process._tickCallback (node.js:415:13) root@riverside-cafe:/usr/local/src/flickrmirror-master#

On Wed, Nov 20, 2013 at 11:15 PM, Mike Kamermans notifications@github.comwrote:

That's quite peculiar. How many collections are in your userdata/yourname/ia/collections dir? Each file should look something like this:

{ "id": "4234238-72157600271556443", "title": "Nature in all its forms", "description": "This collection contains all my photographs of nature, wildlife, and not-so-wildlife (such as pets).", "iconlarge": "http://farm2.staticflickr.com/1368/cols/72157600271556443_e1d256f95a_l.jpg", "iconsmall": "http://farm2.staticflickr.com/1368/cols/72157600271556443_e1d256f95a_s.jpg", "set": [ { "id": "72157600282437628", "title": "Abkhazi garden", "description": "The abkhazi garden was actually someone's garden in the 1940's and has been maintained ever since, see <a href=\"http://www.conservancy.bc.ca/content.asp?sectionack=abkhazi\">www.conservancy.bc.ca/content.asp?sectionack=abkhazi for more information and visit it if you can, it's well worth it ^^" }, ... { "id": "72157600273331630", "title": "UBC botanical garden", "description": "In june 2006 I took a trip to the botanical garden at the University of British Columbia, armed with a camera, tripod, and some lenses. This is the result of that little trip." } ] }

If there is a set property but it's empty, that might be a possible reason. Can I ask you to check if anything seems irregular in those collection files?

— Reply to this email directly or view it on GitHubhttps://github.com/Pomax/flickrmirror/issues/11#issuecomment-28958738 .

glowrocks commented 10 years ago

being the stubborn person I am, I manually added all missing descriptions. Now have a new error; perhaps something I entered by accident, but ... once the null description bug is fixed I'll just resync .

SyntaxError: Unexpected string at Object.parse (native) at /usr/local/src/flickrmirror-master/node_modules/flickrapi/src/handlers/ia.js:98:23 at Array.forEach (native) at readAll (/usr/local/src/flickrmirror-master/node_modules/flickrapi/src/handlers/ia.js:89:11) at Object.loadLocally (/usr/local/src/flickrmirror-master/node_modules/flickrapi/src/handlers/ia.js:188:23) at getIA (/usr/local/src/flickrmirror-master/routes/index.js:38:19) at handler.index (/usr/local/src/flickrmirror-master/routes/index.js:159:16) at callbacks (/usr/local/src/flickrmirror-master/node_modules/express/lib/router/index.js:164:37) at param (/usr/local/src/flickrmirror-master/node_modules/express/lib/router/index.js:138:11) at paramCallback (/usr/local/src/flickrmirror-master/node_modules/express/lib/router/index.js:150:30)

On Wed, Nov 20, 2013 at 11:25 PM, Mike Rodriquez mike@mike-sheryl.comwrote:

I'll check after the downloads complete, but I have a feeling there will be more than before.

Unfortunately, I have little disk space on this 5$ VM, so I had to delete my old copy of images. (hated to do it, but ...)

and it just finished syncing, but w/errors. there are 6 json files in the collections folder. I have 6 sets, so that matches.

I looked at one of the files and there are multiple instances where the property description is not set. so you may be on the right path.

here's the latest downsync error; it could be temporary as I've seen a bunch of those since starting this yesterday evening. figured those are flickr or my isp's fault.

==========================================================================-] 5912/5913 done downloading photo metadata.

Downloading set metadata from Flickr.

[=====================================================================================================================================================================================--------------------------------------------------------------------------------------------] 182/274 TypeError: Cannot read property 'statusCode' of undefined at Request._callback (/usr/local/src/flickrmirror-master/node_modules/flickrapi/src/utils.js:169:43) at self.callback (/usr/local/src/flickrmirror-master/node_modules/flickrapi/node_modules/request/index.js:148:22) at Request.EventEmitter.emit (events.js:95:17) at ClientRequest.self.clientErrorHandler (/usr/local/src/flickrmirror-master/node_modules/flickrapi/node_modules/request/index.js:258:10) at ClientRequest.EventEmitter.emit (events.js:95:17) at Socket.socketOnEnd as onend at Socket.g (events.js:175:14) at Socket.EventEmitter.emit (events.js:117:20) at _stream_readable.js:920:16 at process._tickCallback (node.js:415:13) root@riverside-cafe:/usr/local/src/flickrmirror-master#

On Wed, Nov 20, 2013 at 11:15 PM, Mike Kamermans <notifications@github.com

wrote:

That's quite peculiar. How many collections are in your userdata/yourname/ia/collections dir? Each file should look something like this:

{ "id": "4234238-72157600271556443", "title": "Nature in all its forms", "description": "This collection contains all my photographs of nature, wildlife, and not-so-wildlife (such as pets).", "iconlarge": "http://farm2.staticflickr.com/1368/cols/72157600271556443_e1d256f95a_l.jpg", "iconsmall": "http://farm2.staticflickr.com/1368/cols/72157600271556443_e1d256f95a_s.jpg", "set": [ { "id": "72157600282437628", "title": "Abkhazi garden", "description": "The abkhazi garden was actually someone's garden in the 1940's and has been maintained ever since, see <a href=\"http://www.conservancy.bc.ca/content.asp?sectionack=abkhazi\">www.conservancy.bc.ca/content.asp?sectionack=abkhazi for more information and visit it if you can, it's well worth it ^^" }, ... { "id": "72157600273331630", "title": "UBC botanical garden", "description": "In june 2006 I took a trip to the botanical garden at the University of British Columbia, armed with a camera, tripod, and some lenses. This is the result of that little trip." } ] }

If there is a set property but it's empty, that might be a possible reason. Can I ask you to check if anything seems irregular in those collection files?

— Reply to this email directly or view it on GitHubhttps://github.com/Pomax/flickrmirror/issues/11#issuecomment-28958738 .

Pomax commented 10 years ago

yeah, that's an error about the data that you added not being the correct format (when I do that, I've usually forgotten to a comma somewhere, or have one too many thanks to copy-paste)

Pomax commented 10 years ago

error reproduced, debugged and fixed in https://github.com/Pomax/flickrmirror/issues/10