question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when updating service: {"message":"invalid service version '': strconv.ParseUint: parsing \"\": invalid syntax"}

See original GitHub issue

Hi,

I’m trying to update existing service using following code:

protected static void restartProxy(){
	var config = buildConfig();  
	DockerClient dockerClient = DockerClientImpl.getInstance(config, buildClient(config));  
	var bupsvc = dockerClient.listServicesCmd().withNameFilter(Arrays.asList("bupx_proxy")).exec().get(0);  
        log.info(version.toString());
	dockerClient.updateServiceCmd(bupsvc.getId(), bupsvc.getSpec()).exec();  
}

However, I’m always getting back the aforementioned error: Exception in thread "main" com.github.dockerjava.api.exception.BadRequestException: Status 400: {"message":"invalid service version '': strconv.ParseUint: parsing \"\": invalid syntax"}

Output of the line log.info(version.toString()) is: INFO: 2504654

docker-java version: 3.2.7

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
fkrivskycommented, Jan 13, 2021

@tduverge - thank you, this workaround helped!

Still feels like an issue though as the version info is already passed along in the service specs so this step is redundant and counter-intuitive.

1reaction
tduvergecommented, Jan 12, 2021

Hi,

Same issue for me,

I did this to fix it :

   dockerClient
       .updateServiceCmd(serviceToUpdate.getId(), serviceSpec)
       .withVersion(serviceToUpdate.getVersion().getIndex())
       .exec();
Read more comments on GitHub >

github_iconTop Results From Across the Web

"panic: strconv.ParseInt: parsing " ": invalid syntax" --> when ...
1. The error shows the string representation of what you're parsing, which obviously isn't a number. · @JimB how to convert int64 into...
Read more >
Docker Swarm Scale Service using update API
Response: < HTTP/1.1 500 Internal Server Error {“message”:“Invalid service version '': strconv.ParseUint: parsing “”: invalid syntax”}.
Read more >
Custom Vault plugin exiting on windows with strconv.ParseInt
ParseInt : parsing "": invalid syntax error ... This plugin have windows version, but when I'm trying to enable it on windows I'm...
Read more >
Telegraf 1.16 and higher - error when starting
Hi, starting with version 1.16, the telegraf service crash with this ... ParseInt: parsing “Add”: invalid syntax goroutine 1 [running]: ...
Read more >
strconv.ParseInt: parsing "": invalid syntax - Discuss Dgraph
Hi, I am running into a strange issue, version 1.0.6 (I know there are other issues with this release). I am querying a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found