Compile service down?

I can’t get “particle flash DEVICEID” to return anything other than errors at the moment. Here’s what I’m getting:

Flash device failed.
{ Error: socket hang up
    at createHangUpError (_http_client.js:253:15)
    at TLSSocket.socketOnEnd (_http_client.js:345:23)
    at emitNone (events.js:91:20)
    at TLSSocket.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:974:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9) code: 'ECONNRESET' }

Then after trying again, I’m getting this:

Flash device failed.
{ Error: connect ETIMEDOUT 52.0.104.117:443
    at Object.exports._errnoException (util.js:1022:11)
    at exports._exceptionWithHostPort (util.js:1045:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
  code: 'ETIMEDOUT',
  errno: 'ETIMEDOUT',
  syscall: 'connect',
  address: '52.0.104.117',
  port: 443 }

Just gave it a shot and it seems to work for me alright. Might be a connection issue on your end?

I did a restart of my machine; no change.
Tried once more and then it suddenly compiled!
Tried yet another time and this time it’s just hanging. I’ve waited 15 minutes, but the task never ends.
Cancelled and tried a fourth time - now it compiled…

There is definitely something wonkey here?

It looks like it is server related https://stackoverflow.com/questions/40228074/nodejs-tlssocket-onhangup
How can one notify Particle Staff?

It is almost consistent. Every other compile will time out and then it will compile.

I just realised - this is definitely a server issue. The compiler output shows errors that have long been fixed, so the server is caching old code instead of using the current code.

Checking on my side.

@jenschr, compile seems ok on my side. Can you try using the Web IDE?

CLI works for me as well:

KENMBP:Desktop kennethlimcp$ pcp test.ino 

Compiling code for photon

Including:
    test.ino
attempting to compile firmware 
downloading binary from: /v1/binaries/592d521a4a00ab5635d130c7
saving to: photon_firmware_1496142352492.bin
Memory use: 
   text	   data	    bss	    dec	    hex	filename
   4460	      8	   1424	   5892	   1704	/workspace/target/workspace.elf

Compile succeeded.
Saved firmware to: /Users/kennethlimcp/Desktop/photon_firmware_1496142352492.bin

I've seen ECONNRESET on clients side issues before as well, when the connection was killed for whatever reason.
I still cannot reproduce the issue, and particle compile photon tinker.ino works fine on multiple occasions wihtout a hiccup.

The same device programs fine using the web ide. It is however not an option since this project is too complex for the web IDE.

Just to have tried it, I logged out of my account. Logging in took almost a minute?

@kennethlimcp I’m compiling & uploading using “particle flash DEVICEID”. What’s “pcp”?

That’s just my alias for particle compile photon :wink:

Hmm… Is the CLI uploading some none firmware files like .md or something?

Can you show the directory tree of your project? I think it might be hitting the upload size limit for the compile service.

That seems to indicate that the cloud is fine, and it's most likely an issue on the client side.

Could you try compiling first, and then uploading? Shouldn't really make a difference, but doesn't hurt to try.
Also, could you try a more simple project, and see if that does work reliably?

@Moors7 “particle compile p1” returns the same error as “particle compile”

@kennethlimcp aha! I’m not uploading any non-cpp files, but it’s 84 files altogether making up 107Kb? What are those limits actually?

Can you add an empty file c9a3b85f-86cc-4374-8834-148f9ca14080.cpp to your project then do a build?

That’s so I can find which build is yours in the compile farm logs.

Thanks,
Rick

@rickkas7 will need to provide the official answer here.

Can you elaborate how complex? (I see you've meanwhile already clarified :blush:)

There is a (IMHO questionable) statement that "too big projects" should rather be built with local toolchain than via the build farms - which might play a role, but isn't a valid excuse :sunglasses:

I dunno what happened, but now everything is back to normal. Compile times are down to 20 seconds (normal for this project). The Particle Status page has indicated no errors all the time. While the problem persisted, I had more than 3 minutes compile time, but since only every second compile worked it took me 6 minutes for each change.

I will certainly put in the last effort to make it compile properly locally. My problem is that I can’t get it to work properly since something isn’t being linked as it should. It compiles fine, but the output does not contain a valid app:

text data bss dec hex filename
6476 8 1780 8264 2048 …/…/…/myproject/target/myproject.elf

Both the other two binaries compile as they should (system-part1 + system-part2), but my local app compiles without errors, but does not contain the app itself. It works for simpler stuff. I’ll keep that in a separate thread though.