Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

LemonSync connection fails with missing edit_theme #17

Open
tomcornall opened this issue Jan 15, 2016 · 10 comments
Open

LemonSync connection fails with missing edit_theme #17

tomcornall opened this issue Jan 15, 2016 · 10 comments

Comments

@tomcornall
Copy link
Contributor

Editing theme name missing causes exception message, like:

File "/usr/local/bin/lemonsync", line 9, in <module>

load_entry_point('lemonsync==0.1.19', 'console_scripts', 'lemonsync')()

File "build/bdist.macosx-10.11-x86_64/egg/lemonsync/LemonSync.py", line 156, in main

File "build/bdist.macosx-10.11-x86_64/egg/lemonsync/LemonSync.py", line 96, in run_utils

File "build/bdist.macosx-10.11-x86_64/egg/lemonsync/Utils.py", line 57, in file_changes

TypeError: sequence item 2: expected string or Unicode, NoneType found
Issues:
  1. LemonSync is expecting a value without checking first
  2. Connection allows null value to go through
To Do:

Check value
Emit error if check fails (before connection)
Figure out how to set the value

See: https://github.com/lemonstand/lemonsync/blob/master/lemonsync/Utils.py#L57

@ChrisZieba
Copy link
Contributor

Does the api call '/api/v2/identity/s3' return a null value for theme? Isn't there always suppose to be a theme that is being actively edited? If so, I would edit that api response to return a non 200 if there is no theme.

@tomcornall
Copy link
Contributor Author

@ChrisZieba
Yes a null value is returned. I agree it shouldn't respond with 200 - should check the theme before making the connection.

@robotpony
Copy link
Member

There is an active theme, just not an editing theme. Both the API and lemonsync are at fault:

  • API should return a better result (40x)
  • LemonSync shouldn't crash

@ChrisZieba
Copy link
Contributor

The call to /api/v2/identity/s3 in Connector shouldn't event return the theme and bucket - it;s used to return a signed url I think. That should be a separate call. Those endpoints might even exist in the API.

@robotpony
Copy link
Member

We haven't changed it, it's however it was when you left ;-)

@ChrisZieba
Copy link
Contributor

Yes Bruce, I'm aware. I was simply giving some constructive feedback for the design :)

@DavidOliver
Copy link

I'm a new user of LemonSync and am getting this TypeError. My store seems to have a theme activated and marked as editing. As far as I remember, I've never edited the theme name, which is La Boutique (API code laboutique). I've just exported it, and the name in theme.yaml matches the online theme name.


screenshot from 2016-01-16 17 11 04

screenshot from 2016-01-16 17 30 35

My lemonsync.cfg:

[api]
api_host = https://ald.lemonstand.com
api_key = ...
api_access = ...

[dir]
watch_dir = /media/Storage/Work/Work/Advanced Lighting Direct/Website/Theme
file_patterns = [ "*" ]
ignore_patterns = [ "*.tmp", "*.TMP", "*/.git*", "*.DS_STORE" ]

[store]
store_host = ald.lemonstand.com

I'm running the Linux version. Python 2.7.6.

Does anyone know how I can get LemonSync working? Thanks.

@tomcornall
Copy link
Contributor Author

Reproduced:
  • New store has no table value for edit_theme
  • Once newly installed theme is selected as the editing theme edit_theme shows up in database
Steps to solve:

Fill in edit_theme with default value (zest currently) during store creation

@tomcornall
Copy link
Contributor Author

@tomcornall
Copy link
Contributor Author

NOTE: Simple fix by clicking Make currently editing in store dashboard in the meantime

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants