1. #1
    Ext JS Premium Member burnnat's Avatar
    Join Date
    Jun 2011
    Posts
    418
    Vote Rating
    61
    burnnat is a jewel in the rough burnnat is a jewel in the rough burnnat is a jewel in the rough burnnat is a jewel in the rough

      1  

    Default Error upgrading workspace packages

    Error upgrading workspace packages


    I have multiple Sencha apps (each in their own workspace), and have been using packages from my local repository to share code between them. This worked great under Sencha Cmd 3.1.1, but after upgrading to 3.1.2, I find I now get an error when running "sencha app refresh --packages" to update each app to the latest package version.

    I've put together a simplified example, using a package named "test" in two workspaces: "source", where the package is first created, and "dest", another workspace requiring the same package. (I'm running Windows 7, by the way.)

    To create the package, I ran:
    Code:
    C:\workspaces\source>sencha generate package --name test --type code
    
    [ modify "creator" in C:\workspaces\source\packages\test\package.json to match local repo ]
    
    C:\workspaces\source>cd packages\test
    
    C:\workspaces\source\packages\test>sencha package build
    
    C:\workspaces\source\packages\test>sencha package add ..\..\build\test\test.pkg
    Sencha Cmd v3.1.2.342
    [INF] Adding package file ..\..\build\test\test.pkg
    [INF] Package added: test / 1.0.0
    
    C:\workspaces\dest>sencha app refresh --packages
    [INF] Including theme package ext-theme-classic for app.theme=ext-theme-classic build
    [INF] Including code package test for build
    [INF] Package is already local: test/1.0.0
    Which all works as expected. Then suppose I make some changes to the package and want to build a new version:
    Code:
    [ modify "version" in C:\workspaces\source\packages\test\package.json to "1.0.1" ]
    
    C:\workspaces\source\packages\test>sencha package build
    
    C:\workspaces\source\packages\test>sencha package add ..\..\build\test\test.pkg
    Sencha Cmd v3.1.2.342
    [INF] Adding package file ..\..\build\test\test.pkg
    [INF] Package added: test / 1.0.1
    So far so good. But now when I attempt to refresh the "dest" app to pull in the new version:
    Code:
    C:\workspaces\dest>sencha app refresh --packages
    [INF] Including theme package ext-theme-classic for app.theme=ext-theme-classic build
    [INF] Including code package test for build
    [WRN] Cannot extract package test to C:\workspaces\dest\packages\test because a folder by that name already exists, possibly for another version of this pacakge
    [WRN] if this is related to an application, please run 'sencha app refresh -pacakges' to upgrade packages
    [ERR] null
         at java.io.File.<init>(Unknown Source)
         at com.sencha.command.environment.WorkspaceEnvironment.loadPackageEnvironment(WorkspaceEnvironment.java:163)
         at com.sencha.command.environment.WorkspaceEnvironment$1.map(WorkspaceEnvironment.java:116)
         at com.sencha.command.environment.WorkspaceEnvironment$1.map(WorkspaceEnvironment.java:113)
         at com.sencha.util.CollectionUtil.transform(CollectionUtil.java:47)
         at com.sencha.util.CollectionUtil$MonadicList.transform(CollectionUtil.java:244)
         at com.sencha.command.environment.WorkspaceEnvironment.loadPackageEnvironments(WorkspaceEnvironment.java:112)
         at com.sencha.command.environment.WorkspaceEnvironment.resolvePackageEnvironments(WorkspaceEnvironment.java:90)
         at com.sencha.command.environment.AppOrPackageEnvironment.getRequiredPackageEnvironments(AppOrPackageEnvironment.java:165)
         at com.sencha.command.environment.AppOrPackageEnvironment.getRequiredPackagesNoThemes(AppOrPackageEnvironment.java:212)
         at com.sencha.command.environment.AppOrPackageEnvironment.getRequiredPackageNamesNoThemes(AppOrPackageEnvironment.java:203)
         at com.sencha.command.environment.AppEnvironment.<init>(AppEnvironment.java:66)
         at com.sencha.command.environment.BuildEnvironment.load(BuildEnvironment.java:193)
         at com.sencha.command.Sencha.loadBuildEnvironment(Sencha.java:374)
         at com.sencha.command.Sencha.main(Sencha.java:127)
    Any idea why this is happening or what is causing it? If I look at the packages in the local repo, things seem okay:
    Code:
    C:\workspaces>sencha package list .
    Sencha Cmd v3.1.2.342
    [INF] Listing of local catalog
    [INF]    Package test
    [INF]       1.0.1, 1.0.0
    [INF]    Package test
    [INF]       1.0.1, 1.0.0
    [INF]    2 package(s)
    (I'm not sure why the results are listed twice, but I think that happened under 3.1.1 as well. Also probably unrelated is the spelling error of "pacakge" and "-pacakges" in the refresh warning message. )

    Any thoughts? I can't think of anything I'd be doing wrong, so I'm pretty stumped at this point... Any help is appreciated!

  2. #2
    Ext JS Premium Member burnnat's Avatar
    Join Date
    Jun 2011
    Posts
    418
    Vote Rating
    61
    burnnat is a jewel in the rough burnnat is a jewel in the rough burnnat is a jewel in the rough burnnat is a jewel in the rough

      1  

    Default


    Bump... anybody else seeing this problem?

    As a workaround, I've determined that if I delete all the packages out of the workspace (i.e. everything under C:\workspaces\dest\packages) and then run "sencha app refresh --packages" the command completes fine. Of course, doing that before every refresh is rather tedious, so I'd still like to know if the root cause is a bug in Sencha Cmd or some error on my part...

  3. #3
    Sencha Premium Member
    Join Date
    Jan 2013
    Posts
    42
    Vote Rating
    4
    mbingham is on a distinguished road

      1  

    Default


    I'm encountering the same problem. I've triple checked my package.json has suitable values for version and local.

    Code:
    {
        "name": "ff-code-lib",
        "type": "code",
        "creator": "ff",
        "summary": "FF Component Library",
        "detailedDescription": "Fflib.view.PanelPort, Fflib.data.proxy.VFRemote, Fflib.form.field.BoxSelect and patches",
        "version": "1.1.1",
        "compatVersion": "1.1.0",
        "format": "1",
        "local": false,
        "requires": []
    }
    I'm using an HTTP-hosted Sencha Repository to distribute my Sencha Packages. However he chokes the same as yours and I have to rm -rf packages/ to pull the new versions.

    Code:
    [INF] Including code package ff-code-lib for build
    [INF] Including theme package ff-theme-cobalt for app.theme=ff-theme-cobalt build
    [INF] Including locale package ff-locale-sf for app.locale=sf build
    [WRN] Cannot extract package ff-theme-cobalt to /Users/mbingham/Workspace/commons/sencha/scaffold/dev/resource/scaffoldZip/packages/ff-theme-cobalt because a folder by that name already exists, possibly for another version of this pacakge
    [WRN] if this is related to an application, please run 'sencha app refresh -pacakges' to upgrade packages
    [ERR] null
         at java.io.File.<init>(File.java:222)
         at com.sencha.command.environment.WorkspaceEnvironment.loadPackageEnvironment(WorkspaceEnvironment.java:163)

Thread Participants: 1