getsentry / sentry-cli

A command line utility to work with Sentry.
https://docs.sentry.io/cli/
BSD 3-Clause "New" or "Revised" License
900 stars 221 forks source link

EOF while parsing a value at line 1 column 0 #374

Closed mbabker closed 4 years ago

mbabker commented 6 years ago

One of my iOS apps is missing a debug file, so I copied the command from the processing issues page for that project and whenever I run it I always get the "EOF while parsing a value at line 1 column 0" error message.

I have tried installing sentry-cli via Homebrew and the automatic installation script from https://docs.sentry.io/learn/cli/installation/#automatic-installation, as well as completely deleting sentry-cli and letting the script that the processing issues page instructs me to download and execute install its own version of sentry-cli, and in all cases the same error occurs.

I am using a late 2014 Mac Mini running OS X 10.12.6.

mikemliu commented 6 years ago

Yeah same. I'm invoking sentry-cli via fastlane. Was working until I switched machines.

Prob related to #94

mikemliu commented 6 years ago

Worked. I think latest version expects a path to uncompressed .DSYMs

Once I point it to a path and not a zip file, worked. Still, the fastlane plugin is broken since it's feeding the upload-dif command a zip file arg.

This works

sentry-cli --auth-token *** upload-dif --org *** --project *** ./

This doesn't

sentry-cli --auth-token *** upload-dif --org *** --project *** ./xyz.dSYM.zip
mbabker commented 6 years ago

Thanks for the pointer. So after downloading the script that I was being pointed to, it's trying to run this command in essence:

sentry-cli --auth-token <token> upload-dsym --derived-data --no-zips --uuid <uuid> --require-all

Seems the script must be run in the same directory as the dSYM files, because passing a full path fails too:

sentry-cli --auth-token <token> upload-dsym --derived-data --no-zips --uuid <uuid> --require-all ~/Library/Developer/Xcode/Archives/2018-09-06/<app>/dSYMs/

But this does work:

cd ~/Library/Developer/Xcode/Archives/2018-09-06/<app>/dSYMs/
sentry-cli --auth-token <token> upload-dsym --derived-data --no-zips --uuid <uuid> --require-all

I don't recall seeing anything in the documentation about a requirement to be in the same directory as the dSYM files, so I'd suggest two things:

Michaels-Mac-mini:dSYMs mbabker$ sentry-cli upload-dsym --help
sentry-cli-upload-dsym 
DEPRECATED: Upload Mac debug symbols to a project.

USAGE:
    sentry-cli upload-dsym [OPTIONS] [--] [PATH]...
evfemist commented 6 years ago

had same EOF while parsing. Ended up with using sentry-cli directly in Fastfile

ipa_path = gym(scheme: scheme, configuration: configuration, ...)
dsym_path = ipa_path.sub('.ipa', '.app.dSYM.zip')
sh("sentry-cli --auth-token YOUR_AUTH_TOKEN upload-dsym --org YOUR_ORG_SLUG --project YOUR_PROJECT_SLUG #{dsym_path}")
jan-auer commented 6 years ago

@mikemliu Any chance you could send one of those ZIPs to jan.auer@sentry.io? Seems like we might have a bug in unpacking ZIPs.

We are aware that the reprocessing script might currently fail under some circumstances. It was not intended to have the requirement of running in the same directory. Instead, it should look in XCode's derived data folder (hence --derived-data) for the debug files.

Regardless, you should always be able to pass custom paths to sentry-cli upload-dif. Could you please post which errors you are getting when trying to pass a path as opposed to not passing one?

mikemliu commented 6 years ago

It is indeed a path issue, since if I execute the command giving it the current directory ./ it finds the zipped symbol file as expected. My project is using bitcode so requires downloading the dsym zip prior to uploading (hence the fastlane plugin).

cihati commented 5 years ago

EDIT: I looked into /Users/distiller/Library/Logs/gym/mobile-mobile.log inside CircleCI container, and saw that the real issue was "Error:fseventsunavailable (this watcher can only be used on Darwin)". I do brew install watchman and now the issue is gone

I am having this error, but not related to dsym. Explained here https://github.com/getsentry/react-native-sentry/issues/135#issuecomment-447366274 in detail. Any ideas? @jan-auer

anniewey commented 5 years ago

@mikemliu Can you share the path that you used?

skizzo commented 5 years ago

Having this issue too, from one day to the other, without updating anything. After running this command

sentry-cli --auth-token MY-AUTH-TOKEN-REPLACED-FOR-GITHUB --log-level=debug react-native codepush 'reimmund3-ios' ios ./dist/codepush/ios/CodePush --deployment Production --org 'nerdybirdy' --project 'reimmund3-ios'

My terminal output is:

  INFO    2019-05-12 12:30:23.767290 +02:00 Loaded config from /Users/steff/.sentryclirc
  DEBUG   2019-05-12 12:30:23.767540 +02:00 sentry-cli version: 1.42.0, platform: "darwin", architecture: "x86_64"
  INFO    2019-05-12 12:30:23.767559 +02:00 sentry-cli was invoked with the following command line: "sentry-cli" "--auth-token" "MY-AUTH-TOKEN-REPLACED-FOR-GITHUB" "--log-level=debug" "react-native" "codepush" "reimmund3-ios" "ios" "./dist/codepush/ios/CodePush" "--deployment" "Production" "--org" "nerdybirdy" "--project" "reimmund3-ios"
> Fetching latest code-push package info
  DEBUG   2019-05-12 12:30:27.795272 +02:00 error: running update nagger
  INFO    2019-05-12 12:30:27.795474 +02:00 Running update nagger update check
  DEBUG   2019-05-12 12:30:27.795512 +02:00 request GET https://release-registry.services.sentry.io/apps/sentry-cli/latest
  DEBUG   2019-05-12 12:30:27.795533 +02:00 retry number 0, max retries: 0
  DEBUG   2019-05-12 12:30:28.287535 +02:00 > GET /apps/sentry-cli/latest HTTP/1.1
  DEBUG   2019-05-12 12:30:28.287562 +02:00 > Host: release-registry.services.sentry.io
  DEBUG   2019-05-12 12:30:28.287571 +02:00 > Accept: */*
  DEBUG   2019-05-12 12:30:28.287579 +02:00 > Connection: TE
  DEBUG   2019-05-12 12:30:28.287587 +02:00 > TE: gzip
  DEBUG   2019-05-12 12:30:28.287594 +02:00 > User-Agent: sentry-cli/1.42.0
  DEBUG   2019-05-12 12:30:28.420191 +02:00 < HTTP/1.1 200 OK
  DEBUG   2019-05-12 12:30:28.420229 +02:00 < Server: nginx
  DEBUG   2019-05-12 12:30:28.420244 +02:00 < Date: Sun, 12 May 2019 10:30:28 GMT
  DEBUG   2019-05-12 12:30:28.420257 +02:00 < Content-Type: application/json
  DEBUG   2019-05-12 12:30:28.420270 +02:00 < Content-Length: 721
  DEBUG   2019-05-12 12:30:28.420281 +02:00 < Connection: close
  DEBUG   2019-05-12 12:30:28.420292 +02:00 < Strict-Transport-Security: max-age=2592000
  DEBUG   2019-05-12 12:30:28.420975 +02:00 response status: 200
  INFO    2019-05-12 12:30:28.421017 +02:00 Looking for file named: sentry-cli-Darwin-x86_64
  DEBUG   2019-05-12 12:30:28.421025 +02:00 body: {"canonical":"app:sentry-cli","file_urls":{"sentry-cli-Darwin-x86_64":"https://downloads.sentry-cdn.com/sentry-cli/1.42.0/sentry-cli-Darwin-x86_64","sentry-cli-Linux-i686":"https://downloads.sentry-cdn.com/sentry-cli/1.42.0/sentry-cli-Linux-i686","sentry-cli-Linux-x86_64":"https://downloads.sentry-cdn.com/sentry-cli/1.42.0/sentry-cli-Linux-x86_64","sentry-cli-Windows-i686.exe":"https://downloads.sentry-cdn.com/sentry-cli/1.42.0/sentry-cli-Windows-i686.exe","sentry-cli-Windows-x86_64.exe":"https://downloads.sentry-cdn.com/sentry-cli/1.42.0/sentry-cli-Windows-x86_64.exe"},"main_docs_url":"https://docs.sentry.io/learn/cli","name":"Sentry CLI","repo_url":"https://github.com/getsentry/sentry-cli","version":"1.42.0"}

  INFO    2019-05-12 12:30:28.421060 +02:00 Found asset sentry-cli-Windows-i686.exe
  INFO    2019-05-12 12:30:28.421067 +02:00 Found asset sentry-cli-Linux-x86_64
  INFO    2019-05-12 12:30:28.421074 +02:00 Found asset sentry-cli-Linux-i686
  INFO    2019-05-12 12:30:28.421095 +02:00 Found asset sentry-cli-Windows-x86_64.exe
  INFO    2019-05-12 12:30:28.421107 +02:00 Found asset sentry-cli-Darwin-x86_64
error: EOF while parsing a value at line 1 column 0
  DEBUG   2019-05-12 12:30:28.422064 +02:00 client close; no transport to shut down  (from sentry)

Anybody has an idea? I can't update any of my apps any more, need to solve this immediately.

sibelius commented 5 years ago

is there any workaround?

ghost commented 5 years ago

Getting this same error. Not sure how to solve this

sregg commented 5 years ago

For me the issue was happening when I was building a different scheme (e.g. staging). I fixed it by checking that I'm running the sentry-cli script only for the prod scheme.

I replaced the Bundle React Native code and images build phase script with this:

export DEVELOPMENT_BUILD_CONFIGURATIONS="+(Dev.Debug|Stage.Debug|Debug)"
export NODE_BINARY=node
# disable sentry-cli for stage and dev schemes
# only run it for prod scheme
if [ "${CONFIGURATION}" == "Release" ]; then
    echo 'running sentry-cli'
    export SENTRY_PROPERTIES=sentry.properties

    ../node_modules/@sentry/cli/bin/sentry-cli --log-level=debug react-native xcode --force-foreground ../node_modules/react-native-schemes-manager/lib/react-native-xcode.sh
    exit 0
fi

echo 'skipping sentry-cli'
 ../node_modules/react-native-schemes-manager/lib/react-native-xcode.sh

and if you're like me and you're using react-native-schemes-manager you have to put that script in package.json in xcodeSchemes.settings.fix-script.nodeCommand

"settings": {
  "fix-script": {
    "nodeCommand": "# disable sentry-cli for stage and dev schemes\\n# only run it for prod scheme\\nif [ \\\"${CONFIGURATION}\\\" == \\\"Release\\\" ]; then\\n    echo 'running sentry-cli'\\n    export SENTRY_PROPERTIES=sentry.properties\\n\\n    ../node_modules/@sentry/cli/bin/sentry-cli --log-level=debug react-native xcode --force-foreground ../node_modules/react-native-schemes-manager/lib/react-native-xcode.sh\\n    exit 0\\nfi\\n\\necho 'skipping sentry-cli'\\n"
  }
}
kamilogorek commented 4 years ago

Closing the issue, as it seems like the original issue has been partially resolved or there is a working solution. I'd prefer someone to create a new issue with a fresh description if it's still an issue. Please do not hesitate to ping me if it is still relevant, and I will happily reopen and work on it. Cheers!

nturpin commented 4 years ago

@kamilogorek we just started getting the error described here. I opened a new issue linking to this one. Please let us know about any possible workarounds or fixes.

cannc4 commented 3 years ago

Same here. Really odd and feels unstable to see this error pop up every once in a while.

kamilogorek commented 3 years ago

I suggest upgrading to 1.64.0 which has a more descriptive error message and should make debugging easier. Cheers!