-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Value Error on line 224of install.py #13
Comments
Not a SyntaxError, but a ValueError. Anyway I'll fix it snappy |
Resolved by 11a8fdb |
ok after fetch, I am still getting same error. git is already the newest version. |
Will reopen a new bug I guess? |
You mean "git pull"? Fetch just requests the latest objects from the origin; pull will update your working copy. |
Whoops. I am pretty new to this. git pull fixed that issue and now a new one. ;) Restarted supervisord ############################################################ Done! Your new grocery list can be found at: Traceback (most recent call last): |
Thanks for helping me find all these bugs! I've fixed the grocery board URL in install.py, but you should be all set now to start using Oscar. You can find your grocery list by just going into the Trello web UI and looking for the "Groceries" board. As the rest of the message would have said: print 'If everything worked, then you should be able to start scanning'
print 'barcodes with oscar. Check out the logs of the scanner process and'
print 'the web app, respectively, at'
print
print ' /var/lib/supervisor/log/oscar_scan.log'
print ' /var/lib/supervisor/log/oscar_web.log'
print
print 'And report any bugs at https://github.com/danslimmon/oscar/issues.'
print
print 'To add new product description keywords, the current method is to'
print 'edit the oscar_db board directly. This should change soon with #5.'
print
print 'Enjoy!' |
I thought that might be the case, I ran python /var/oscar/scan.py I am not sure if this is a digit-eyes error or not. To confirm, the APP K code should have the //xyzabc (the two slashes) when you run it? Waiting for scanner data |
The app key should begin and end with a slash. There shouldn't be two slashes in a row. Did your config file end up with an app key with two slashes in a row? If so, I'd be interested to see your original input, since that would indicate another bug in install.py. |
in the oscar.yaml it shows as you said eg: /abcxyz/ In the digit-eyes site it shows //abcxyz I ran another git pull and did the install.py (WORKED!!!!) I scanned an nothing happened so then I ran the python /var/oscar/scan.py again. Getting the exact same error as above. |
Interesting. Perhaps it's only my key in particular that starts and ends with a slash. Have you tried replacing the code in /etc/oscar.yaml with exactly what is specified under your Digit-Eyes account? |
Ok, that is what did it. I formatted it the way mine was setup and works fine. So a new issue. :) python /var/oscar/scan.py I didnt get a text and I didnt see any changes to my trello boards (grocery or trello_db) No errors were thrown, I checked the twilio dashboard and it shows a SMS was sent. I am pretty sure there might be something up with the number. I formatted the phone number '16501234567" (twilio_dest and src) |
Just to be clear, you have your Twilio-given phone number as "twilio_src" and your cell phone's number as "twilio_dest", correct? If Twilio says the text was sent, then I'm not sure how much I can help you from here... |
yup. Shouldnt the trello db show the new barcode or does that get updated via the txt message? |
Yes, in your oscar_db board (make sure there wasn't more than one of these created by the install script, since you ran it a few times!) there should now be an entry under "learning opportunities" with the barcode you scanned. If there's not, then oscar_scan messed that up and I'd really appreciate some help debugging that. Can you check? As far as the text goes, it sounds like the text made it to Twilio. I wonder if you're able to send yourself a text message with this simple Python example from the Twilio docs? from twilio.rest import TwilioRestClient
# Your Account Sid and Auth Token from twilio.com/user/account
account_sid = "AC32a3c49700934481addd5ce1659f04d2"
auth_token = ""
client = TwilioRestClient(account_sid, auth_token)
message = client.sms.messages.create(body="Jenny please?! I love you <3",
to="+14159352345", # Replace with your phone number
from_="+14158141829") # Replace with your Twilio number
print message.sid If that doesn't work, then I'd advise you to further debug your Twilio account settings until it does. I don't think I can help a ton with that part. |
Ok, I was wrong, the text never made it to twilio (I even deposited 20 bucks to double double check!) So it looks like there is a APi issue somewhere. Should it be oscar_db? According to install script it was trello_db? I see nothing under learning opportunities but I see the default data (beer, coffee, etc) for description rules. I ran the example python script and it worked perfectly. (event took out 1 cent to send the example text from my account!) |
The board should be called 'oscar_db' and not 'trello_db' (see 97fedac), but in the config it's referred to by its ID, so the incorrect name shouldn't have affected oscar_scan's ability to create a learning opportunity. Still, I'd recommend you rename the board to 'oscar_db' to prevent future confusion. To begin troubleshooting the learning opportunity issue, could you go into /etc/oscar.yaml, look the
|
the data in /etc/oscar.yaml and the string in the URL are the exact same. I renamed to oscar_db Ran python /var/oscar/scan.py and no text and no change to oscar_db on trello |
Just to double check I went to account settings. The install.py defiantly worked as it has all the default data. I am not 100% sure the scan.py is working. oscar Approved: Nov 23 at 2:30 PM |
Try running this test script in /var/oscar on your Pi. Should tell us where things are going wrong: |
Traceback (most recent call last): |
I've updated the script at https://gist.github.com/danslimmon/7633178 to make sure that the current directory is searched for packages, and to make sure it is in /var/oscar when it tries to load trellodb. Try again? |
python fremenusul_test.py [] After creating barcode opp, the contents of learning_opportunities is: Testing notification You should receive a text via Twilio now... |
I did receive a text. |
And do you see that learning opportunity in your oscar_db board? |
Whoops. Sorry, yes {"barcode": "01234567890", "type": "barcode", "created_dt": "2013-11-24 14:37:41", "opp_id": "testabc123"} |
Very strange. So the contents of the functions that are supposed to create and publish your learning opportunity for the Safeway water seem to be working fine. But in the context of a scan.py run for some reason the API calls are failing silently. I'm not sure what to tell you. I can't seem to reproduce your issue on my side, so the only thing I can suggest is that you dig in try to find the exact source of the breakage by modifying the application. If you're not comfortable with Python, though, maybe that's not an option... |
Is there supposed to be something in /var/lib/supervisor/log/oscar_scan.log and /var/lib/supervisor/log/oscar_web.log? The dir is empty for me. I even tried running sudo python /var/oscar/scan.py with the same results. :/ My python is pretty limited but I might try and cobble something together. |
If you're running scan.py by hand from the command line, those files won't be populated. They will contain the output of scan.py and the web app if those things are running under supervisor's control. Check
to see what Supervisor thinks it's running and what the states of those programs are. |
superisorctl status (I am assuming I should run this in the terminal) |
Sorry, supervisorctl -- with a 'v'. |
sudo apt-get install git supervisor |
Very interesting: pi@keyser ~/src/oscar $ sudo supervisorctl reload |
You're still typo-ing "supervisorctl" |
pi@keyser ~/src/oscar $ sudo supervisorctl status |
And the log files are still missing? |
Yup. the dir is still empty |
That either means that supervisor is misconfigured and hasn't been told to write log files to that directory (which shouldn't be the case, but you can check /etc/supervisor/conf.d to make sure) or the scripts it's running haven't produced enough output to log yet. Supervisor (kinda annoyingly) buffers its logfile writes and only flushes those files when a certain amount of data has been written (not every N seconds or something). I'd like to find a way around that, but so far I haven't. :-/ |
the conf's look good. Massive bummer this doesnt seem to be working. I'd be curious if you are running a clean install when you are checking. I re-ran install.py and still having the same issue. No changes to trello, no texts, etc. Does the supervisor run automatically? Anyway, thanks for your help so far, I hope you had a good Sunday in spite of all my posts! |
Your To be fair, I haven't tested the install script on a fresh Pi. I was just sort of crossing my fingers and hoping we would eventually get all the kinks worked out. |
Traceback (most recent call last):
File "./install.py", line 224, in
redirect_stderr=true''')
ValueError: I/O operation on closed file
The text was updated successfully, but these errors were encountered: