logocert_api branch no module named uritemplate #96
Comments
Hi Kelly,
I would reply to you on GitHub but I am missing the 2-factor auth needed to
log in right now from my laptop.
I encountered this same issue on my Mac laptop running OSX El Capitan
10.11.6.
It seems that the OS does not allow the 'six' library to be updated. This
is because the OS has its own 'six.py' located under
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
which is not modifiable.
By default, the aforementtioned location is checked before the
site-packages location where user installed packages live, therefore the
out-of-date six.py is used. By setting the PYTHONPATH env variable, we can
force the site-packages to be searched first, and this allowed me to get
past the error.
Either run the following each time you open a new terminal or add to your
bash profile:
*export PYTHONPATH=/Library/Python/2.7/site-packages*
Hope this fixes it for you!
Cheers,
Kevin
…On Thu, Dec 22, 2016 at 7:28 PM, Kelly Lucas ***@***.***> wrote:
Assigned #96 <#96> to
@lrbom <https://github.com/lrbom>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#96 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AWK4F2S9Gh_rJBkJwaxnDx1PPx0eoanRks5rKz_mgaJpZM4LUjVi>
.
|
I think we should either document this or change our code so this doesn't
become an issue. I'm traveling now but when I get back home from vacation
I'll try it.
Kelly
kdLucas
…On Fri, Dec 23, 2016 at 8:42 PM, lrbom ***@***.***> wrote:
Hi Kelly,
I would reply to you on GitHub but I am missing the 2-factor auth needed to
log in right now from my laptop.
I encountered this same issue on my Mac laptop running OSX El Capitan
10.11.6.
It seems that the OS does not allow the 'six' library to be updated. This
is because the OS has its own 'six.py' located under
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
which is not modifiable.
By default, the aforementtioned location is checked before the
site-packages location where user installed packages live, therefore the
out-of-date six.py is used. By setting the PYTHONPATH env variable, we can
force the site-packages to be searched first, and this allowed me to get
past the error.
Either run the following each time you open a new terminal or add to your
bash profile:
*export PYTHONPATH=/Library/Python/2.7/site-packages*
Hope this fixes it for you!
Cheers,
Kevin
On Thu, Dec 22, 2016 at 7:28 PM, Kelly Lucas ***@***.***>
wrote:
> Assigned #96 <#96>
to
> @lrbom <https://github.com/lrbom>.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#96 (comment)
>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AWK4F2S9Gh_
rJBkJwaxnDx1PPx0eoanRks5rKz_mgaJpZM4LUjVi>
> .
>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#96 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADk_fTQSJGGzMI__ziLsjPq3YVPvd7Jpks5rLKK8gaJpZM4LUjVi>
.
|
Sounds good Kelly, I will document this in the README.
Since this only affects a subset of Mac OS versions and the fix is simple
enough, I will just advise users to run the export command.
Enjoy your vacation!
Kevin
On Sun, Dec 25, 2016 at 4:44 PM, Kelly Lucas <notifications@github.com>
wrote:
… I think we should either document this or change our code so this doesn't
become an issue. I'm traveling now but when I get back home from vacation
I'll try it.
Kelly
kdLucas
On Fri, Dec 23, 2016 at 8:42 PM, lrbom ***@***.***> wrote:
> Hi Kelly,
>
> I would reply to you on GitHub but I am missing the 2-factor auth needed
to
> log in right now from my laptop.
>
> I encountered this same issue on my Mac laptop running OSX El Capitan
> 10.11.6.
> It seems that the OS does not allow the 'six' library to be updated. This
> is because the OS has its own 'six.py' located under
> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7
> which is not modifiable.
>
> By default, the aforementtioned location is checked before the
> site-packages location where user installed packages live, therefore the
> out-of-date six.py is used. By setting the PYTHONPATH env variable, we
can
> force the site-packages to be searched first, and this allowed me to get
> past the error.
>
> Either run the following each time you open a new terminal or add to your
> bash profile:
>
> *export PYTHONPATH=/Library/Python/2.7/site-packages*
>
> Hope this fixes it for you!
>
> Cheers,
> Kevin
>
> On Thu, Dec 22, 2016 at 7:28 PM, Kelly Lucas ***@***.***>
> wrote:
>
> > Assigned #96 <#96>
> to
> > @lrbom <https://github.com/lrbom>.
> >
> > —
> > You are receiving this because you were mentioned.
> > Reply to this email directly, view it on GitHub
> > <#96#
event-903735994
> >,
> > or mute the thread
> > <https://github.com/notifications/unsubscribe-auth/AWK4F2S9Gh_
> rJBkJwaxnDx1PPx0eoanRks5rKz_mgaJpZM4LUjVi>
> > .
> >
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <#96#
issuecomment-269068894>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ADk_fTQSJGGzMI__
ziLsjPq3YVPvd7Jpks5rLKK8gaJpZM4LUjVi>
> .
>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#96 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AWK4F3qOj6309gHw3Yebda9lu7q3e7CRks5rLw3igaJpZM4LUjVi>
.
|
Ok, I updated my shell by running the following in my shell: export PYTHONPATH=/Library/Python/2.7/site-packages Now I see the following error: |
Seems like the same error as before, caused by the old version of six
being loaded. My guess is either the export path doesn't point to a
directory containing six or the six in the directory is out of date. If
it's the latter, running 'pip install six' should fix it.
…On Jan 22, 2017 6:01 PM, "Kelly Lucas" ***@***.***> wrote:
Ok, I updated my shell by running the following in my shell:
export PYTHONPATH=/Library/Python/2.7/site-packages
Now I see the following error:
Traceback (most recent call last):
File "./testcert.py", line 149, in setUpModule
getTokens()
File "./testcert.py", line 245, in getTokens
GetNewTokens()
File "./testcert.py", line 282, in GetNewTokens
creds = run_flow(flow, _storage, flags=flags,http=http)
File "/Library/Python/2.7/site-packages/oauth2client/_helpers.py", line
133, in positional_wrapper
return wrapped(*args, **kwargs)
File "/Library/Python/2.7/site-packages/oauth2client/tools.py", line 218,
in run_flow
authorize_url = flow.step1_get_authorize_url()
File "/Library/Python/2.7/site-packages/oauth2client/_helpers.py", line
133, in positional_wrapper
return wrapped(*args, **kwargs)
File "/Library/Python/2.7/site-packages/oauth2client/client.py", line
1934, in step1_get_authorize_url
return _helpers.update_query_params(self.auth_uri, query_params)
File "/Library/Python/2.7/site-packages/oauth2client/_helpers.py", line
222, in update_query_params
parts = urllib.parse.urlparse(uri)
AttributeError: 'Module_six_moves_urllib_parse' object has no attribute
'urlparse'
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#96 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AWK4F6ZQN3395Ig0Cq0_x9jLHZ5U8wajks5rVAnsgaJpZM4LUjVi>
.
|
Executing sudo pip install --ignore-installed six fixed that issue. Proceeding. |
I set the printer name to M477, and now executing testcert.py, it hangs. I'm seeing the following: I'll check if there is an issue with the way we're checking for names, as maybe it needs to be M477fdw in the _config.py file. I'll add more debug info this evening. |
Wait_for_privet_mdns_service() waits indefinitely for zeroconf threads to be terminated and this is likely the case for you. I have updated the code to wait up to 30 seconds only for the threads to terminate, and continue operation regardless of successful termination or not. This is pushed to logocert_api now. As for name checking, M477 should be matched since it is a substring of the service "HP Color LaserJet MFP M477fdw (6D418f)._privet._tcp.local." |
Now it's executing after your latest change. So far I've run a couple of test suites. I'll update after I've run through all of them. |
Everything is working pretty good. I've tested the test suites up to jobstate. Once I got there I see some jobs are in error or queued states: No jobs have printed. Attaching the last log as well. |
Today I was running more of the jobstate tests, and I got a continual message: LogoCert INFO: Access token expired, need to refresh it |
I believe this happened because the test account was used by one of the
testers yesterday for logocert_api testing.
When they authenticated for the first time, new tokens were generated so
the refresh token stored in your local credentials.txt is now invalid.
This error should not occur once you delete credentials.txt from the tool's
directory and run the script again.
I have updated the script to output a more informative log message that
notifies the user to delete credentials.txt and try again.
…On Thu, Jan 26, 2017 at 11:25 PM, Kelly Lucas ***@***.***> wrote:
Today I was running more of the jobstate tests, and I got a continual
message:
LogoCert INFO: Access token expired, need to refresh it
Trying again in 1 sec(s)
Bad status code from Submit(): 403
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#96 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AWK4F5NoG8olL65iq6xLXzM3aEF9Iijdks5rWZvdgaJpZM4LUjVi>
.
|
Ok, I wonder if we should put something in the setUpModule to automatically do this if we detect this error. |
Upon further inspection, my previous conclusion is wrong.
The HTTP 403 responses did not result from a stale credentials.txt file,
rather, the auth token needed for GCP interface interactions has expired.
An auth token lasts 1 hour and is refreshed before every testsuite. In the
case that a user is idle and the testsuite takes longer than 1 hour to run,
this error will occur.
The JobState testsuite should not take longer than 1 hour to run so this
would be an edge case.
I'm tracking this as an issue since it would be nice for the tool to
refresh tokens automatically when token expiration is detected.
Link to issue: #98
…On Fri, Jan 27, 2017 at 10:52 AM, Kelly Lucas ***@***.***> wrote:
Ok, I wonder if we should put something in the setUpModule to
automatically do this if we detect this error.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#96 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AWK4FwjzkpSeHJmjatqSg3_vSrA5WCWkks5rWjzygaJpZM4LUjVi>
.
|
Since the latest changes were made, I'm now seeing: "No printers discovered under HP Color LaserJet MFP M477fdw". Previously I saw: LogoCert INFO: Service added: "HP Color LaserJet MFP M477fdw ..." and in my _config.py I have: 'MODEL': 'M477', However, when I changed 'NAME' to read 'M477fdw' it started working, so spaces might be an issue. For me it's fine if spaces are not allowed, but we should document it. |
When running through the tests, when I ran the test for testJobStateEmptyInputTray, the job goes into the Queued state but the test fails, saying it didn't find the job in the queued or In Progress state. |
Looks like I may need to update the printer firmware, as I think it has an issue with the version of Java. |
I updated the firmware and now tests are passing as expected. For the Name string, I don't think it was related to string handling, as I think it had more to do with the printer failure to send mDNS packets. I've now completed the JobState suite, and will move to the cloud printing suite next. |
I completed all of the CloudPrinting suite tests. I noticed a number of tests failed with an Error. Not sure why. Nothing was attempted to print. I've attached the log. |
I attempted to run the LocalPrinting suite. The first print job printed; however, testcert.py bailed out with:
|
Regarding the CloudPrinting failures, the attached logs are only the info
level logs which do not tell the whole picture, perhaps there are better
notes left in the Google sheets. Let me know if you can find anything.
…On Thu, Feb 2, 2017 at 9:07 PM, Kelly Lucas ***@***.***> wrote:
I completed all of the CloudPrinting suite tests. I noticed a number of
tests failed with an Error. Not sure why. Nothing was attempted to print.
I've attached the log.
LogoCert2017February02_204831.log.zip
<https://github.com/google/cloudprint_logocert/files/749609/LogoCert2017February02_204831.log.zip>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#96 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AWK4F0a3pdi-SiSXR70lsZectFkxSMt5ks5rYrYagaJpZM4LUjVi>
.
|
For the LocalPrinting suite error, the assertion error came during the set
up process when the tool makes calls to the GCP /submit api to create jobs
for the purpose of leveraging the cloud to convert images into raster
files. After /submit is called, the /download api is used to retrieve the
raster image. The assertion error comes from the failure of the /download
api call.
…On Thu, Feb 2, 2017 at 9:15 PM, Kelly Lucas ***@***.***> wrote:
I attempted to run the LocalPrinting suite. The first print job printed;
however, testcert.py bailed out with:
./testcert.py
Adding LocalPrinting to list of suites to run
LogoCert INFO: Got new access token.
LogoCert INFO: Service added: "HP Color LaserJet MFP M477fdw
(6D418F)._privet._tcp.local."
LogoCert INFO: All listeners have been stopped.
LogoCert INFO: Device URL: http://192.168.1.65:80
LogoCert INFO: Got new access token.
Starting LocalPrinting testSuite
============================================================
====================
/Users/kdlucas/src/logocert_api/cloudprint_logocert/images/testpage.pwg
not found.
Likely that this is the first time LocalPrinting suite is run.
Generating pwg-raster via cloud print
Attempting to submit a job through GCP for up to 60 seconds
Job submitted successfully
[Configurable timeout] PRINTER_STATUS:
Waiting up to 180 seconds for the printer to have status: processing
<function FetchRaster at 0x10223dc80> failed
ERROR
======================================================================
ERROR: setUpClass (*main*.LocalPrinting)
Traceback (most recent call last):
File "./testcert.py", line 2284, in setUpClass
getLocalPrintingRasterImages()
File "./testcert.py", line 337, in getLocalPrintingRasterImages
getRasterImageFromCloud(Constants.IMAGES['PWG1'],
Constants.IMAGES['PNG7'])
File "./testcert.py", line 323, in getRasterImageFromCloud
res = _gcp.FetchRaster(output['job']['id'])
File "/Users/kdlucas/src/logocert_api/cloudprint_logocert/_cpslib.py",
line 94, in VerifyNotNone
raise AssertionError
AssertionError
------------------------------
Ran 0 tests in 194.276s
FAILED (errors=1)
LogoCert2017February02_210849.log.zip
<https://github.com/google/cloudprint_logocert/files/749619/LogoCert2017February02_210849.log.zip>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#96 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AWK4FzLTxQZJrHDNdjWlMAs3-7xzpeRNks5rYrfsgaJpZM4LUjVi>
.
|
Ah, ok, maybe I'll turn up the debug level to debug to get more information. |
That might just do the trick. For me, the console raw output with the
Google sheets notes usually do a good job of pointing out the errors.
…On Feb 3, 2017 10:38 AM, "Kelly Lucas" ***@***.***> wrote:
Ah, ok, maybe I'll turn up the debug level to debug to get more
information.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#96 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AWK4F3Q2QYyfjTxu73JyvdFiY6sW4OLXks5rY3Q8gaJpZM4LUjVi>
.
|
Ok, I'm going to rename the spreadsheet to a unique name and run it again. It will be owned by testcloudprint30. |
So I reran the tests, and all of the tests that had errors (39 of them) did not make any entry in the spreadsheet. So I'm going to rerun with debug enabled. |
Here is the log file in debug mode. |
Kevin and I were discussing possible failure scenarios, and we think that another issue here could be that some printers may not support some of the CJT options that the tests is passing in. Need to increase error messages to understand better why there are failures with certain printers in the CloudPrinting suite. |
I found the culprit. It was a method for adding color options in a CJT that was raising the unhandled exception. This occurs when the printer does not include 'vendor_id' in its capabilities for color options. This issue is now fixed. |
Ok, I grabbed your latest changes and all of the tests passed except one. The failure was with test PrintJpgDpiSetting, AttributeError: 'Cloudprinting' object has no attribute 'Submit'. If you log in as testcloudprint30, you can see the spreadsheet called LogoCert_api_cjtchanges for details. |
I still can't get any tests to pass in the LocalPrinting suite, as when the first test runs, it does print the page, but I see: ======================================================================
|
The CloudPrinting error has been fixed and pushed, it was a typo in a function name. Great catch! As for the LocalPrinting error, I can only pinpoint it to some failure in the /download GCP API call. In the setup code for LocalPrinting, Cloud Printing is leveraged for converting several images to the raster format that will be used for LocalPrinting. The procedure goes like this:
I have added better console logging in FetchRaster() so hopefully this will help us get to the root of the issue. |
I have pushed up a change in LocalPrinting. It now waits on the GCP job state instead of the Privet printer state when it's determining when to access the /download API for the raster image. This should fix your issue Kelly. |
Thanks for making the changes, I'll test this over the weekend. |
Ok, I ran ran the local printing suite. I noticed the printer I was testing on failed tests for:
And at the end of the tests I saw: Wait for idle state before starting a local print job LogoCert INFO: Test ID: 533d4ac6-5c1d-4c99-a91e-2bac7c31864f ====================================================================== ====================================================================== Traceback (most recent call last): |
Ok, I tested the rest of the the printing suites, and it all looks good. I think we should be ready to close out this issue and move to the next stage of getting this branch pushed into our main branch. |
I attempted to set up and run the logocert_api branch today on OSX, running Python 2.7.10, and when testcert.py executes, I get:
File "./testcert.py", line 49, in
import _sheets
File "/Users/kdlucas/src/logocert_api/cloudprint_logocert/_sheets.py", line 22, in
import _gdocs
File "/Users/kdlucas/src/logocert_api/cloudprint_logocert/_gdocs.py", line 31, in
from googleapiclient import discovery
File "/Library/Python/2.7/site-packages/googleapiclient/discovery.py", line 53, in
import uritemplate
ImportError: No module named uritemplate
The googleapiclient is installed. I try to debug a bit and find out what else needs to be installed.
I fixed the issue by installing uritemplate with:
sudo pip install uritemplate.py
I then got another error:
./testcert.py
Adding SystemUnderTest to list of suites to run
Adding Privet to list of suites to run
/Library/Python/2.7/site-packages/oauth2client/_helpers.py:255: UserWarning: Cannot access credentials.txt: No such file or directory
warnings.warn(_MISSING_FILE_MESSAGE.format(filename))
No handlers could be found for logger "oauth2client.client"
ERROR
ERROR: setUpModule (main)
Traceback (most recent call last):
File "./testcert.py", line 149, in setUpModule
getTokens()
File "./testcert.py", line 245, in getTokens
GetNewTokens()
File "./testcert.py", line 282, in GetNewTokens
creds = run_flow(flow, _storage, flags=flags,http=http)
File "/Library/Python/2.7/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
return wrapped(*args, **kwargs)
File "/Library/Python/2.7/site-packages/oauth2client/tools.py", line 218, in run_flow
authorize_url = flow.step1_get_authorize_url()
File "/Library/Python/2.7/site-packages/oauth2client/_helpers.py", line 133, in positional_wrapper
return wrapped(*args, **kwargs)
File "/Library/Python/2.7/site-packages/oauth2client/client.py", line 1934, in step1_get_authorize_url
return _helpers.update_query_params(self.auth_uri, query_params)
File "/Library/Python/2.7/site-packages/oauth2client/_helpers.py", line 222, in update_query_params
parts = urllib.parse.urlparse(uri)
AttributeError: 'Module_six_moves_urllib_parse' object has no attribute 'urlparse'
I haven't yet figured out how to solve this.
The text was updated successfully, but these errors were encountered: