Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

The Swift server crashed 5 times in the last 3 minutes. The server will not be restarted. #38

Open
gkrosl opened this issue Jun 9, 2017 · 6 comments

Comments

@gkrosl
Copy link

gkrosl commented Jun 9, 2017

I get error from Swift SDE in vscode on linux mint 18.1 (based on ubuntu 16.04 Xenial).

Here is the output copied from vscode:

/home/gorazd/.vscode/extensions/jinmingjian.sde-2.0.20170209/out/src/server/server.js:40
for (const m of pkgDesc['modules']) {
^

TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined
at Socket.sp.stdout.on (/home/gorazd/.vscode/extensions/jinmingjian.sde-2.0.20170209/out/src/server/server.js:40:32)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at Pipe.onread (net.js:551:20)
[Info - 11:04:21 AM] Connection to server got closed. Server will restart.
/home/gorazd/.vscode/extensions/jinmingjian.sde-2.0.20170209/out/src/server/server.js:40
for (const m of pkgDesc['modules']) {
^

TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined
at Socket.sp.stdout.on (/home/gorazd/.vscode/extensions/jinmingjian.sde-2.0.20170209/out/src/server/server.js:40:32)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at Pipe.onread (net.js:551:20)
[Info - 11:04:22 AM] Connection to server got closed. Server will restart.
/home/gorazd/.vscode/extensions/jinmingjian.sde-2.0.20170209/out/src/server/server.js:40
for (const m of pkgDesc['modules']) {
^

TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined
at Socket.sp.stdout.on (/home/gorazd/.vscode/extensions/jinmingjian.sde-2.0.20170209/out/src/server/server.js:40:32)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at Pipe.onread (net.js:551:20)
[Info - 11:04:22 AM] Connection to server got closed. Server will restart.
/home/gorazd/.vscode/extensions/jinmingjian.sde-2.0.20170209/out/src/server/server.js:40
for (const m of pkgDesc['modules']) {
^

TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined
at Socket.sp.stdout.on (/home/gorazd/.vscode/extensions/jinmingjian.sde-2.0.20170209/out/src/server/server.js:40:32)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at Pipe.onread (net.js:551:20)
[Info - 11:04:23 AM] Connection to server got closed. Server will restart.
/home/gorazd/.vscode/extensions/jinmingjian.sde-2.0.20170209/out/src/server/server.js:40
for (const m of pkgDesc['modules']) {
^

TypeError: Cannot read property 'Symbol(Symbol.iterator)' of undefined
at Socket.sp.stdout.on (/home/gorazd/.vscode/extensions/jinmingjian.sde-2.0.20170209/out/src/server/server.js:40:32)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:176:18)
at Socket.Readable.push (_stream_readable.js:134:10)
at Pipe.onread (net.js:551:20)
[Error - 11:04:24 AM] Connection to server got closed. Server will not be restarted.

I am using Swift 4.0 however and can't go back to 3.1.

All the best,
Gorazd

@cognition9144
Copy link

Same problem

@cognition9144
Copy link

This problem disappears when I remove the .build folder.

@gkrosl
Copy link
Author

gkrosl commented Jun 20, 2017

Unfortunately, removing .build folder does not help. I get exactly the same message as posted originally.

@cognition9144
Copy link

You're right... This problem shows up again.

@ainopara
Copy link

ainopara commented Sep 8, 2017

JSON format from swift package describe --type json changed in SwiftPM 4.0
Example to show the new format:

{
  "name": "sourcekite",
  "path": "/Users/ainopara/Documents/Projects/sourcekite",
  "targets": [
    {
      "c99name": "sourcekitd",
      "module_type": "ClangTarget",
      "name": "sourcekitd",
      "path": "/Users/ainopara/Documents/Projects/sourcekite/Sources/sourcekitd",
      "sources": [
        "dummy.c"
      ],
      "type": "library"
    },
    {
      "c99name": "sourcekite",
      "module_type": "SwiftTarget",
      "name": "sourcekite",
      "path": "/Users/ainopara/Documents/Projects/sourcekite/Sources/sourcekite",
      "sources": [
        "main.swift",
        "utils.swift"
      ],
      "type": "executable"
    }
  ]
}

modules is removed, that's why there is error in for (const m of pkgDesc['modules']) {.

You need to add

"swift.path.swift_driver_bin": "path/to/swift3"

in VS Code settings to make sure a SwiftPM from swift 3 is used.
path/to/swift3 can be

  • /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift if you have Xcode 8 installed.
  • /Users/your-username/.swiftenv/shims/swift if you are using swiftenv and global environment is setted to a swift 3 toolchain.

@renanyoy
Copy link

renanyoy commented Oct 8, 2017

thanks for SDE/sourcekite
for me, all is working except autocomplete and variables watching in debug mode
in debug mode I have only the callstack & breakpoints working..
will be nice to have swiftPM 4 support, it will be a lot easier to setup..

my setup: elementary os (ubuntu 16.04 like), swift 4, sourcekite in docker

@vknabel vknabel mentioned this issue Oct 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants