Last Comment Bug 574563 - Error: The system was unable to find the specified registry key or value
: Error: The system was unable to find the specified registry key or value
Status: RESOLVED FIXED
[cherry-pick-1.3]
:
Product: Add-on SDK
Classification: Client Software
Component: General (show other bugs)
: unspecified
: x86 Windows XP
: P3 normal (vote)
: ---
Assigned To: Myk Melez [:myk] [@mykmelez]
:
Mentors:
: 588245 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-06-24 21:14 PDT by Erik Vold
Modified: 2011-11-29 14:53 PST (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch v1: fixes problem (1.18 KB, patch)
2011-10-13 17:14 PDT, Myk Melez [:myk] [@mykmelez]
markh: feedback+
Details | Diff | Review
patch v2: resolves trivial application conflicts (1.37 KB, patch)
2011-11-02 10:46 PDT, Myk Melez [:myk] [@mykmelez]
warner-bugzilla: review+
Details | Diff | Review

Description Erik Vold 2010-06-24 21:14:39 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.4) Gecko/20100611 Firefox/3.6.4
Build Identifier: 

I get the following error when I bin\activate:

"Error:  The system was unable to find the specified registry key or value"

everything else seems to be working ok so far..

Reproducible: Always

Steps to Reproduce:
0. On windows XP..
1. hg clone http://hg.mozilla.org/labs/jetpack-sdk/
2. cd jetpack-sdk
3. bin\activate
Actual Results:  
C:\jetpack-sdk\jetpack-sdk>bin\activate

Error:  The system was unable to find the specified registry key or value
Welcome to the Jetpack SDK. Run 'cfx docs' for assistance.

Expected Results:  
C:\jetpack-sdk\jetpack-sdk>bin\activate

Welcome to the Jetpack SDK. Run 'cfx docs' for assistance.
Comment 1 James Hartig 2010-07-25 20:46:25 PDT
I think this was a problem with python 2.7 as well. Try going back to 2.6.
Comment 2 Myk Melez [:myk] [@mykmelez] 2010-08-26 14:48:27 PDT
*** Bug 588245 has been marked as a duplicate of this bug. ***
Comment 3 Myk Melez [:myk] [@mykmelez] 2010-08-26 14:49:15 PDT
I see the problem, and I'm using Python 2.6.
Comment 4 Myk Melez [:myk] [@mykmelez] 2010-11-11 01:37:09 PST
The Add-on SDK is no longer a Mozilla Labs experiment and has become a big enough project to warrant its own Bugzilla product, so the "Add-on SDK" product has been created for it, and I am moving its bugs to that product.

To filter bugmail related to this change, filter on the word "looptid".
Comment 5 Myk Melez [:myk] [@mykmelez] 2011-06-15 12:54:56 PDT
(automatic reprioritization of 1.0 bugs)
Comment 6 Wes Kocher (:KWierso) 2011-09-08 12:09:57 PDT
(Pushing all open bugs to the --- milestone for the new triage system)
Comment 7 Wes Kocher (:KWierso) 2011-10-12 21:48:54 PDT
This is possibly related to bug 684136. I no longer see this error after applying the pull request in that bug (and removing all Python registry entries and reinstalling Python).

Anyone care to confirm?
Comment 8 Myk Melez [:myk] [@mykmelez] 2011-10-13 17:14:22 PDT
Created attachment 566982 [details] [diff] [review]
patch v1: fixes problem

(In reply to Wes Kocher (:KWierso) (Jetpack Bugmaster) from comment #7)
> This is possibly related to bug 684136. I no longer see this error after
> applying the pull request in that bug (and removing all Python registry
> entries and reinstalling Python).
> 
> Anyone care to confirm?

I noticed that too, but it turns out that change just masked the bug, which is a combination of:

1. the `REG QUERY "%PYTHONKEY%\%PYTHONVERSION%\InstallPath" /ve` call doesn't redirect stdout/err to /dev/null, so any errors generated by that command are printed to the terminal (unlike other such calls in the script, which are all redirected);

2. the `if %ERRORLEVEL% EQU 0` checks inside the `if` conditional blocks are not checking the return codes they think they're checking, because %ERRORLEVEL% is expanded before the conditional block is evaluated, per <http://stackoverflow.com/questions/4367930/errorlevel-inside-if> and <http://batcheero.blogspot.com/2007/06/how-to-enabledelayedexpansion.html>.

The fixes are to redirect the output of that command to /dev/null and enable delayed expansion of environment variables.  Here's a patch that does that.  There are other places where %ERRORLEVEL% is checked outside of conditionals; not sure if those should be changed to !ERRORLEVEL! as well (or, alternately, `IF ERRORLEVEL`, which doesn't have this problem).

Mark: I don't know if this matters given plans to land some version of the batch file in bug 571483, but I figured this stuff out in the process of reviewing the fix for bug 684136, so I figured it was worth at least rolling the patch.
Comment 9 Mark Hammond [:markh] 2011-10-13 21:49:26 PDT
Comment on attachment 566982 [details] [diff] [review]
patch v1: fixes problem

I haven't tested it, but it looks good to me.  Note however that this patch will be made obsolete if the one in bug 571843 lands.
Comment 10 Myk Melez [:myk] [@mykmelez] 2011-11-02 10:46:54 PDT
Created attachment 571369 [details] [diff] [review]
patch v2: resolves trivial application conflicts

Given the lack of progress on bug 571843, and in order to capture the learnings from this bug in the historical record, let's move forward on reviewing and landing this bug.  This patch applies to the tip, resolving trivial application conflicts from recent changes.
Comment 11 Brian Warner [:warner :bwarner] 2011-11-03 12:38:21 PDT
Comment on attachment 571369 [details] [diff] [review]
patch v2: resolves trivial application conflicts

I have no idea what this patch does: my windows-fu is non-existent. If it works for you, though, I see no reason to not apply it.
Comment 14 [github robot] 2011-11-29 14:17:52 PST
Commit pushed to https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/d245ef8e91275161b245e3f8649448303cb78508
bug 574563: correctly check ERRORLEVEL in activate.bat; squelch REG QUERY error; f=@mhammond, r=@warner

Note You need to log in before you can comment on or make changes to this bug.