Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 420342

Summary: "TypeError: cannot call method 'set' of undefined" when opening file
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: ClientAssignee: Mark Macdonald <mamacdon>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: P3 CC: adrian.aichner, ahunter.eclipse
Version: 4.0   
Target Milestone: 4.0 RC3   
Hardware: PC   
OS: Windows NT   
Whiteboard:

Description Mark Macdonald CLA 2013-10-24 19:31:52 EDT
From the orion-dev list http://dev.eclipse.org/mhonarc/lists/orion-dev/msg02637.html

--------------------------
Hi Anthony, this happens for all my files in various directories, e.g.
.js and README.md files.

Here is what I get when I click on README.md in
https://my.local.server:8443/edit/edit.html#/file/adrian/autoSaveText/CWS/

> console.log(error)
TypeError {stack: "TypeError: Cannot call method 'set' of undefined↵
…ps://my.local.server:8443/orion/plugin.js:234:29)", message: "Cannot
call method 'set' of undefined"}

message: "Cannot call method 'set' of undefined"
stack: "TypeError: Cannot call method 'set' of undefined↵ at
Object.FileServiceImpl.read
(https://my.local.server:8443/plugins/filePlugin/fileImpl.js:429:15)↵
at _callMethod (https://my.local.server:8443/orion/plugin.js:182:46)↵
at _handleMessage
(https://my.local.server:8443/orion/plugin.js:234:29)"
__proto__: Error

undefined
> console.trace()

console.trace()

_callMethodplugin.js:211
_handleMessageplugin.js:234

undefined
Comment 1 Adrian Aichner CLA 2013-10-25 08:05:03 EDT
Here are my answers for 
http://dev.eclipse.org/mhonarc/lists/orion-dev/msg02638.html

On Fri, Oct 25, 2013 at 1:38 AM, Mark Macdonald <mamacdon@gmail.com> wrote:
>
> We should probably move this conversation over to Bugzilla. I opened a bug there: https://bugs.eclipse.org/bugs/show_bug.cgi?id=420342

Thanks for entering the bug, Mark!

>
> What would help are some more details about your environment: What browser and platform are you running? Have you customized the fileImpl plugin at all?

I see the same problem in
 firefox nightly
 chrome canary
on
 Windows XP SP3

I also see the problem after cloning a git repository in eclipse orion running with a brand now orion workspace:

 -data /var/home/adrian/eclipse-orion-ws-2

I am still running my orion server under linux (recently upgraded to Kubuntu 13.10).

All I have changed are these:

adrian@tanga:~/git/org.eclipse.orion.client$ git status --short
 M bundles/org.eclipse.orion.client.core/web-ide.conf
 M bundles/org.eclipse.orion.client.core/web-ide.launch
 M modules/orionode/orion.conf
adrian@tanga:~/git/org.eclipse.orion.client$

Here is how I run it:

alias jo2='nohup /usr/lib/jvm/java-7-openjdk-i386/bin/java -Dorg.eclipse.equinox.http.jetty.http.port=8080 -Dorg.eclipse.equinox.http.jetty.autostart=false -Dorion.core.configFile=/var/home/adrian/git/org.eclipse.orion.client/bundles/org.eclipse.orion.client.core/web-ide.conf -Dfile.encoding=UTF-8 -classpath /var/home/adrian/workspace-kepler-4/.metadata/.plugins/org.eclipse.pde.core/.bundle_pool/plugins/org.eclipse.equinox.launcher_1.3.0.v20130327-1440.jar org.eclipse.equinox.launcher.Main -dev file:/var/home/adrian/workspace-kepler-4/.metadata/.plugins/org.eclipse.pde.core/web-ide/dev.properties -configuration file:/var/home/adrian/workspace-kepler-4/.metadata/.plugins/org.eclipse.pde.core/web-ide/ -os linux -ws gtk -arch x86 -nl de_DE -consoleLog -data /var/home/adrian/eclipse-orion-ws-2 -clean -product org.eclipse.orion.product'

I'll keep you posted on any new findings at my end.

Is anybody successfully editing files in an orion server running latest orion/master code?

Adrian

>
> A quick look at the file suggests that `URL.query` is undefined, but I'm having a hard time understanding how that could ever happen under the implementation of URL that Orion uses.
>
> Mark
Comment 2 Anthony Hunter CLA 2013-10-25 10:23:30 EDT
(In reply to Adrian Aichner from comment #1)
> Is anybody successfully editing files in an orion server running latest
> orion/master code?

Yes, we run daily builds on orion.eclipse.org
Comment 3 Anthony Hunter CLA 2013-10-25 10:25:14 EDT
(In reply to Adrian Aichner from comment #1)
> All I have changed are these:
> 
> adrian@tanga:~/git/org.eclipse.orion.client$ git status --short
>  M bundles/org.eclipse.orion.client.core/web-ide.conf
>  M bundles/org.eclipse.orion.client.core/web-ide.launch
>  M modules/orionode/orion.conf

Can you tell me the differences to these files so I can try on my end here?

You may want to clearing your browser cache as well.
Comment 4 Adrian Aichner CLA 2013-10-25 11:13:56 EDT
(In reply to Anthony Hunter from comment #2)
> (In reply to Adrian Aichner from comment #1)
> > Is anybody successfully editing files in an orion server running latest
> > orion/master code?
> 
> Yes, we run daily builds on orion.eclipse.org

My question was aimed at using a deployed orion server to actually edit files using the orion IDE.

I would assume the daily builds only run a limited set of unit tests.

Is orion.eclipse.org runninng daily build based on orion/master?
Comment 5 Mark Macdonald CLA 2013-10-25 11:35:45 EDT
(In reply to Adrian Aichner from comment #4)
> Is orion.eclipse.org runninng daily build based on orion/master?

Yes, it's currently running a build from 10-24, and AFAIK no users have observed this error from fileImpl.js. I am also running a local Orion server off master (launched from Eclipse), and it works OK too.
Comment 6 Adrian Aichner CLA 2013-10-25 11:45:05 EDT
(In reply to Mark Macdonald from comment #5)
> (In reply to Adrian Aichner from comment #4)
> > Is orion.eclipse.org runninng daily build based on orion/master?
> 
> Yes, it's currently running a build from 10-24, and AFAIK no users have
> observed this error from fileImpl.js. I am also running a local Orion server
> off master (launched from Eclipse), and it works OK too.

Thanks for the details, Mark!

Meanwhile I found that my local orion server orion/master as of hours ago) works as expected when access with

navigator.userAgent
"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36"

What I can't understand is why both firefox nightly and chrome canary both show the symptoms of this bug report.

navigator.userAgent
"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1681.2 Safari/537.36"

navigator.userAgent
17:41:23.451 "Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0"

I even tried localStorage.clear() in canary chrome, but after plugin reinstall and hard reloads it still shows the same problem again.

I also cleared
 Cached Web Content
and
 Offline Web Content
in firefox nightly and this did not help.
Comment 7 Anthony Hunter CLA 2013-10-25 11:59:46 EDT
OK, so Chrome 30 works for you but bleeding edge (unreleased?) browsers like Chrome 32 and Firefox 27 fail.

I am on Chrome 29 and Firefox 24 on Ubuntu 12.10 and not seeing an issue.
Comment 8 Mark Macdonald CLA 2013-10-25 12:08:34 EDT
I'll try a Firefox nightly. My only guess at this point is that both FF nightly  and Canary have simultaneously added support for the window.URL constructor in a way that breaks Orion's shim implementation.
Comment 9 Mark Macdonald CLA 2013-10-25 12:12:05 EDT
(In reply to Mark Macdonald from comment #8)
> I'll try a Firefox nightly. My only guess at this point is that both FF
> nightly  and Canary have simultaneously added support for the window.URL
> constructor in a way that breaks Orion's shim implementation.

Yep, this is it -- wow. We are broken quite badly in nightlies.
Comment 10 Mark Macdonald CLA 2013-10-25 15:50:43 EDT
Pushed a fix. skaegi reviewed this
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=447b3f3

Orion's URL shim was conservative and would use the browser's native URL constructor if one was provided. However Minefield and Canary currently have only a partial implementation of the spec (omitting the URLQuery portion), which is problematic for Orion's file service as it relies heavily on queries.

The fix is to detect the incomplete URL implementation and continue to use Orion's shim in that case.

I considered modifying the shim to inject only URLQuery support and rely on the brwoser's native URL implementation for the rest. However, our test suite showed that the nightlies are deviating from spec'd behavior in other cases too, and there's not enough time to sort out the differences in this release.
Comment 11 Adrian Aichner CLA 2013-10-25 16:39:12 EDT
I can confirm the fix to work for my manual testing scenario using

navigator.userAgent
"Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1681.2 Safari/537.36"

I somehow managed to overwrite my firefox nightly installation by updating by released firefox insatllation and therefor can't provide firefox nightly testing for now.
Comment 12 Adrian Aichner CLA 2013-10-25 16:49:51 EDT
I can now confirm the fix to work in my testing with

navigator.userAgent
22:44:04.604 "Mozilla/5.0 (Windows NT 5.1; rv:27.0) Gecko/20100101 Firefox/27.0"
navigator.buildID
22:47:33.797 "20131025100746"

as well.

(I just had to exit firefox 24.0 on my PC, then I was able to start and update my firefox nightly install to 27.0a1 (2013-10-25))