Bug 1125687 - Routine GIT Push Broke NodeJS server apparently irreparably
Summary: Routine GIT Push Broke NodeJS server apparently irreparably
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: OpenShift Online
Classification: Red Hat
Component: Image
Version: 1.x
Hardware: Unspecified
OS: Mac OS
unspecified
urgent
Target Milestone: ---
: ---
Assignee: Ben Parees
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-01 02:10 UTC by Evan Moss
Modified: 2014-08-01 23:40 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-01 23:40:45 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Log of RHC alarming behavior that caused the problems. (226.56 KB, text/rtf)
2014-08-01 02:10 UTC, Evan Moss
no flags Details

Description Evan Moss 2014-08-01 02:10:12 UTC
Created attachment 923050 [details]
Log of RHC alarming behavior that caused the problems.

Description of problem:

I made a routine push to update the code on my NodeJS server.  It started making tons of HTTP requests (see log) that it's never done before, and it didn't seem like it was stopping, so I aborted.  When I tried to push again, it said everything was up to date.  I have tried restarting, stopping, etc. -- everything I could think of, and also modifying files and pushing new commits.  Everything behaves as expected when pushing with the exception that the NodeJS cartridge seems to be broken, and the log error is:

Error: Cannot find module 'bytes'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/var/lib/openshift/53ac92105973cae4570000b1/app-root/runtime/repo/node_modules/express/node_modules/connect/lib/utils.js:393:22)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
DEBUG: Program node server.js exited with code 8
DEBUG: Starting child process with 'node server.js'

Therefore the server won't work because NodeJS isn't compiling, or something to that effect.


Version-Release number of selected component (if applicable):
Node.js 0.10

How reproducible:
Not at all?

Steps to Reproduce:
1. Commit file.
2. Push to origin (openshift)
3. Get (un)lucky

Actual results:
Error: Cannot find module 'bytes'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/var/lib/openshift/53ac92105973cae4570000b1/app-root/runtime/repo/node_modules/express/node_modules/connect/lib/utils.js:393:22)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
DEBUG: Program node server.js exited with code 8
DEBUG: Starting child process with 'node server.js'

Expected results:
Either successfully compiling and running the server, or logging an error regarding pushed updates.

Additional info:
See log.

Comment 1 Balazs Varga 2014-08-01 12:22:54 UTC
Hi Evan,

Are you sure you didn't add a new dependency since your last push? (potentially a framework?). It seems it tried to download the dependencies.

Could you try fix the broken dependencies with git push an empty file:
.openshift/markers/force_clean_build

It will delete and download the npms again.

Comment 2 Evan Moss 2014-08-01 21:04:34 UTC
Wow, thanks so much for your fast response!

I'm sure I didn't add any new dependencies; I only modified a .js file in node_modules/ dir.  The downloading is what confused me, which is why I aborted (and - in retrospect - probably broke something).

Pushing force_clean_build seems to have fixed it!  However, now it seems to force a clean build at every push, even after git rm'ing force_clean_build, and committing * before pushing.  Is there a marker I should be using (I'm not seeing anything for NodeJS in http://openshift.github.io/documentation/oo_cartridge_guide.html#markers-5)

Is there any way to request that this be added to the RHC command line interface?

Thanks so much,
Evan

Comment 3 Ben Parees 2014-08-01 22:37:03 UTC
hmm..it should be gone.  can you ssh into your gear and check that the file is not present  in:
app-root/repo/.openshift/markers

and
app-deployments/current/repo/.openshift/markers

?

Comment 4 Evan Moss 2014-08-01 23:03:33 UTC
It was present in app-root/repo/.openshift/markers so I rm'd it.

I couldn't cd into app-deployments/current/, but I did into the most current timestamped deployment, and I also rm'd it there.

I tried to push a new commit, and I still get:

remote: Force clean build enabled - cleaning dependencies

Thanks,
Evan

Comment 5 Ben Parees 2014-08-01 23:05:59 UTC
if it's still there, then it's still in your git repository...(I suspect if you ssh in again, you'll now see that it's back).

i'd double check that you've successfully pushed the deletion to the remote repository.  (perhaps do a git fetch/pull first)

Comment 6 Evan Moss 2014-08-01 23:14:33 UTC
Hmm, I guess it didn't get committed, whoops.

Yup, I think that fixed it!

Thanks!!
Evan

Comment 7 Ben Parees 2014-08-01 23:26:34 UTC
ok to close this as worksforme?

Comment 8 Evan Moss 2014-08-01 23:40:45 UTC
Yes, thanks again!


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