Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2024.4.2: System.Runtime.Serialization.SerializationException: Property 'compose_version' not found on type 'Bit.Setup.Configuration'. #4059

Closed
tmknight opened this issue May 6, 2024 · 40 comments
Labels

Comments

@tmknight
Copy link

tmknight commented May 6, 2024

Steps To Reproduce

self-hosted, but this appears to be related to the PR to remove the deprecated version attribute from the compose files (#3972):

  1. version 2024.4.1
  2. bitwarden.sh updateself
  3. bitwarden.sh update

Expected Result

All containers start

Actual Result

Status: Image is up to date for bitwarden/setup:2024.4.2
docker.io/bitwarden/setup:2024.4.2

Unhandled exception. YamlDotNet.Core.YamlException: (Line: 6, Col: 1, Idx: 193) - (Line: 6, Col: 1, Idx: 193): Exception during deserialization
---> System.Runtime.Serialization.SerializationException: Property 'compose_version' not found on type 'Bit.Setup.Configuration'.
at YamlDotNet.Serialization.TypeInspectors.TypeInspectorSkeleton.GetProperty(Type type, Object container, String name, Boolean ignoreUnmatched)
at YamlDotNet.Serialization.NodeDeserializers.ObjectNodeDeserializer.YamlDotNet.Serialization.INodeDeserializer.Deserialize(IParser parser, Type expectedType, Func`3 nestedObjectDeserializer, Object& value)
at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
--- End of inner exception stack trace ---
at YamlDotNet.Serialization.ValueDeserializers.NodeValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
at YamlDotNet.Serialization.ValueDeserializers.AliasValueDeserializer.DeserializeValue(IParser parser, Type expectedType, SerializerState state, IValueDeserializer nestedObjectDeserializer)
at YamlDotNet.Serialization.Deserializer.Deserialize(IParser parser, Type type)
at YamlDotNet.Serialization.Deserializer.Deserialize[T](IParser parser)
at YamlDotNet.Serialization.Deserializer.Deserialize[T](TextReader input)
at YamlDotNet.Serialization.Deserializer.Deserialize[T](String input)
at Bit.Setup.Context.LoadConfiguration() in /home/runner/work/server/server/util/Setup/Context.cs:line 154
at Bit.Setup.Program.PrintEnvironment() in /home/runner/work/server/server/util/Setup/Program.cs:line 169
at Bit.Setup.Program.Main(String[] args) in /home/runner/work/server/server/util/Setup/Program.cs:line 61

@tmknight tmknight added the bug label May 6, 2024
@xiconfjs
Copy link

xiconfjs commented May 6, 2024

same problem here. Any progress on creating a workaround? Or is there a way to do a fallback?

@tmknight
Copy link
Author

tmknight commented May 6, 2024

You can replace bitwarden.sh with the one from 2024.4.1 release

@xiconfjs
Copy link

xiconfjs commented May 6, 2024

Ok, workaround is to switch back to version 2024.4.1:

  1. Stop bitwarden ./bitwarden.sh stop
  2. Then change the version to 2024.4.1. Patch:
--- bitwarden.sh_old	2024-05-07 00:45:13.804462923 +0200
+++ bitwarden.sh	2024-05-07 00:44:22.369781760 +0200
@@ -62,8 +62,8 @@
 RUN_SCRIPT_URL="https://func.bitwarden.com/api/dl/?app=self-host&platform=linux&variant=run"

 # Please do not create pull requests modifying the version numbers.
-COREVERSION="2024.4.2"
-WEBVERSION="2024.4.2"
+COREVERSION="2024.4.1"
+WEBVERSION="2024.4.1"
 KEYCONNECTORVERSION="2024.4.0"

 echo "bitwarden.sh version $COREVERSION" 
  1. Start bitwarden again ./bitwarden.sh start

@flotteur
Copy link

flotteur commented May 7, 2024

Ok, workaround is to switch back to version 2024.4.1:

1. Stop bitwarden `./bitwarden.sh stop`

2. Then change the version to 2024.4.1. Patch:
--- bitwarden.sh_old	2024-05-07 00:45:13.804462923 +0200
+++ bitwarden.sh	2024-05-07 00:44:22.369781760 +0200
@@ -62,8 +62,8 @@
 RUN_SCRIPT_URL="https://func.bitwarden.com/api/dl/?app=self-host&platform=linux&variant=run"

 # Please do not create pull requests modifying the version numbers.
-COREVERSION="2024.4.2"
-WEBVERSION="2024.4.2"
+COREVERSION="2024.4.1"
+WEBVERSION="2024.4.1"
 KEYCONNECTORVERSION="2024.4.0"

 echo "bitwarden.sh version $COREVERSION" 
3. Start bitwarden again `./bitwarden.sh start`

I confirm that a rollback this way worked fine.

Thank you!

@sammbw
Copy link

sammbw commented May 7, 2024

Hi there,

Thank you for your report!

I was able to reproduce this issue, and I have flagged this to our engineering team.

If you wish to add any further information/screenshots/recordings etc., please feel free to do so at any time - our engineering team will be happy to review these.

Thanks once again!

@lengran
Copy link

lengran commented May 7, 2024

I'm having this issue when upgrading. I tried to upgrade the docker but that didn't make any difference. I have reverted the script back to 2024.4.1 temporarily for now. Hope this problem will be fixed soon.

@npodbielski
Copy link

I have this on bitwarden.sh version 2024.4.2.
Otherwise works fine. I just can't update it.

@npodbielski
Copy link

I tried commenting out compose_version in bwdata/config.yaml file and it worked.
Also after update finished this property is gone from config so this should be only one-time workaround.

@GuillaumeHullin
Copy link

For me the "workaround" was to simply start manually the containers... I still have the errors but Bitwarden is running.

sudo -u bitwarden /srv/bitwarden/bitwarden.sh start

@CodingMinds
Copy link

For me the "workaround" was to simply start manually the containers... I still have the errors but Bitwarden is running.

sudo -u bitwarden /srv/bitwarden/bitwarden.sh start

I've tried that also, didn't help :(

@GuillaumeHullin
Copy link

For me the "workaround" was to simply start manually the containers... I still have the errors but Bitwarden is running.

sudo -u bitwarden /srv/bitwarden/bitwarden.sh start

I've tried that also, didn't help :(

What error do you get?

@CodingMinds
Copy link

For me the "workaround" was to simply start manually the containers... I still have the errors but Bitwarden is running.

sudo -u bitwarden /srv/bitwarden/bitwarden.sh start

I've tried that also, didn't help :(

What error do you get?

The same as in the OP IIRC. Already did a rollback to the previous version, so can't retry it.

@nex84
Copy link

nex84 commented May 7, 2024

For me the "workaround" was to simply start manually the containers... I still have the errors but Bitwarden is running.

sudo -u bitwarden /srv/bitwarden/bitwarden.sh start

I've tried that also, didn't help :(

What error do you get?

The same as in the OP IIRC. Already did a rollback to the previous version, so can't retry it.

You can retry after running the following:

./bitwarden.sh updateself

This will gather again the new version of the bitwarden.sh script with the faulty versions.

@GuillaumeHullin
Copy link

GuillaumeHullin commented May 7, 2024

I tried commenting out compose_version in bwdata/config.yaml file and it worked. Also after update finished this property is gone from config so this should be only one-time workaround.

@npodbielski seems that you found the bug!
Tested this method successfully and the complete upgrade went through!

@luismiparra
Copy link

I tried commenting out compose_version in bwdata/config.yaml file and it worked. Also after update finished this property is gone from config so this should be only one-time workaround.

It works for me! Thanks!!

@benlenau
Copy link

benlenau commented May 7, 2024

I tried commenting out compose_version in bwdata/config.yaml file and it worked. Also after update finished this property is gone from config so this should be only one-time workaround.

Works!

1 similar comment
@manilx
Copy link

manilx commented May 7, 2024

I tried commenting out compose_version in bwdata/config.yaml file and it worked. Also after update finished this property is gone from config so this should be only one-time workaround.

Works!

@tmknight
Copy link
Author

tmknight commented May 7, 2024

I tried commenting out compose_version in bwdata/config.yaml file and it worked. Also after update finished this property is gone from config so this should be only one-time workaround.

Well spotted! I searched the code for compose_version and nothing came up....well done.

@npodbielski
Copy link

npodbielski commented May 7, 2024

@tmknight I am not sure where you comment go (did you deleted it?) but:

I suggest this is the workaround and not the solution

I did not stated it is the solution. But a way to just ignore this if anyone had a problem get along with their life. I am sure people here have better things to do :)

Unfortunately, my C# isn't the sharpest (pun) and not finding the exact line that is the culprit.

They just removed a prop from whatever class it was serializing config.yaml into. Can not find property and runtime just blows up. No secret there. Probably just someone forgot to test on previous version of the config. Or just a mistake - shit happens.
Anyway if this work it works. Yeah should be fixed but you know... one problem less out of your head :)

@Snafu
Copy link

Snafu commented May 7, 2024

They just removed a prop from whatever class it was serializing config.yaml into. Can not find property and runtime just blows up. No secret there. Probably just someone forgot to test on previous version of the config. Or just a mistake - shit happens.
Anyway if this work it works. Yeah should be fixed but you know... one problem less out of your head :)

Yup, this seems to be the culprit https://github.com/bitwarden/server/pull/3972/files
Obviously there is a regression testing issue though, this should never have been allowed to be rolled out to customers

@grafnull
Copy link

grafnull commented May 7, 2024

I had the same issue. Thanks to the community for the quick workaround.
Is this specific to a Linux release or version?

@GuillaumeHullin
Copy link

I had the same issue. Thanks to the community for the quick workaround. Is this specific to a Linux release or version?

Don't think so. But Debian 12 here.

@Eschin
Copy link

Eschin commented May 7, 2024

I tried commenting out compose_version in bwdata/config.yaml file and it worked. Also after update finished this property is gone from config so this should be only one-time workaround.

This worked for me. And totally agree, this should be a one-time workaround.

Regression tests may not have been thorough enough to catch this. Even after the update failed, my containers started up fine and ran without an issue on the current version (2024.4.1)

Testing can be hard 😄 At least it was a minor issue.

@ninji
Copy link

ninji commented May 7, 2024

Same issue here after trying to solve new issues with HELO-Rejects from SMTP-Server.
Got different error messages from same call like "unknown option public on network", differs from call to call.
Ending up rebuilding from backup snapshot.

I never lernt from it, tried it again, a simple

./bitwarden.sh updateself
./bitwarden.sh update

to

ERROR: The Compose file '/opt/bitwarden/bwdata/docker/docker-compose.yml' is invalid because:
Unsupported config option for services: 'admin'
Unsupported config option for networks: 'public'
ERROR: The Compose file '/opt/bitwarden/bwdata/docker/docker-compose.yml' is invalid because:
Unsupported config option for services: 'attachments'
Unsupported config option for networks: 'public'
root@vault:/opt/bitwarden#

@yobyot
Copy link

yobyot commented May 7, 2024

I tried commenting out compose_version in bwdata/config.yaml file and it worked. Also after update finished this property is gone from config so this should be only one-time workaround.

Worked for me, too.

Sumthin's happening to quality in Bitwarden. After 18 months of quiet, reliable upgrades and new feature additions...suddenly this week, it's driving me crazy. I sure hope this is only a burp and not a slow descent.

@trmartin4
Copy link
Member

Thank you for reporting this issue. We have addressed the problem, and you can run ./bitwarden.sh update and it will grab the latest setup image and complete successfully.

Please feel free to re-open if you continue to have issues.

@DanielGerecht
Copy link

After update nothing works with the error
ERROR: Version mismatch: file /srv/docker/bitwarden/bwdata/docker/docker-compose.yml specifies version 1 but extension file /srv/docker/bitwarden/bwdata/docker/docker-compose.override.yml uses version 3.0
and when i search for compose_ver in the /bwdata/config.yml nothing is there

@ninji
Copy link

ninji commented May 8, 2024

Nope

ERROR: The Compose file '/opt/bitwarden/bwdata/docker/docker-compose.yml' is invalid because:
Unsupported config option for services: 'api'
Unsupported config option for networks: 'public'
ERROR: The Compose file '/opt/bitwarden/bwdata/docker/docker-compose.yml' is invalid because:
Unsupported config option for services: 'attachments'
Unsupported config option for networks: 'default'
root@vault:/opt/bitwarden#

Rebuild with a new snapshot again...

@nex84
Copy link

nex84 commented May 8, 2024

Nope

ERROR: The Compose file '/opt/bitwarden/bwdata/docker/docker-compose.yml' is invalid because:
Unsupported config option for services: 'api'
Unsupported config option for networks: 'public'
ERROR: The Compose file '/opt/bitwarden/bwdata/docker/docker-compose.yml' is invalid because:
Unsupported config option for services: 'attachments'
Unsupported config option for networks: 'default'
root@vault:/opt/bitwarden#

Rebuild with a new snapshot again...

I had the same issue with docker-compose version 1.25.1.
I fixed it by updating to Docker Compose version v2.27.0 (https://docs.docker.com/compose/install/standalone/)

@mathias-ioki
Copy link

mathias-ioki commented May 8, 2024

Same here. Looks like it's enough to add

version: '3'

at the start of the bwdata/docker/docker-compose.yml file as a workaround.

@DanielGerecht
Copy link

Nope

ERROR: The Compose file '/opt/bitwarden/bwdata/docker/docker-compose.yml' is invalid because:
Unsupported config option for services: 'api'
Unsupported config option for networks: 'public'
ERROR: The Compose file '/opt/bitwarden/bwdata/docker/docker-compose.yml' is invalid because:
Unsupported config option for services: 'attachments'
Unsupported config option for networks: 'default'
root@vault:/opt/bitwarden#

Rebuild with a new snapshot again...

I had the same issue with docker-compose version 1.25.1. I fixed it by updating to Docker Compose version v2.27.0 (https://docs.docker.com/compose/install/standalone/)

i did a VM Clone and this worked for me too, now im gonna do that on the Productive VM later today my docker-compose versionw as 1.26 despite the ubuntu package manage saying 1.29.0

@davidhildebrand
Copy link

davidhildebrand commented May 8, 2024

Having the same problem here and the suggested workarounds haven't worked.

A couple days ago, an update failed with the error:

Unhandled exception. YamlDotNet.Core.YamlException: (Line: 6, Col: 1, Idx: 193) - (Line: 6, Col: 1, Idx: 193): Exception during deserialization

I've tried the manual bitwarden.sh patch, but it fails (note that it fails with all the stop/update/start commands with the same kind of error):

bitwarden@zf:~$ ./bitwarden.sh update
 _     _ _                         _            
| |__ (_) |___      ____ _ _ __ __| | ___ _ __  
| '_ \| | __\ \ /\ / / _` | '__/ _` |/ _ \ '_ \ 
| |_) | | |_ \ V  V / (_| | | | (_| |  __/ | | |
|_.__/|_|\__| \_/\_/ \__,_|_|  \__,_|\___|_| |_|

Open source password management solutions
Copyright 2015-2024, 8bit Solutions LLC
https://bitwarden.com, https://github.com/bitwarden

===================================================

bitwarden.sh version 2024.4.1
Docker version 24.0.2, build cb74dfc
docker-compose version 1.26.2, build eefe0d31

ERROR: The Compose file '/opt/bitwarden/bwdata/docker/docker-compose.yml' is invalid because:
Unsupported config option for networks: 'public'
Unsupported config option for services: 'web'
bitwarden@zf:~$ 

Adding version: '3' to bwdata/docker/docker-compose.yml also did not work.

Any idea what else I can try to get around this issue?

@GuillaumeHullin
Copy link

Upgrade Docker?

This is my version data:

bitwarden.sh version 2024.4.2
Docker version 26.1.1, build 4cf5afa
Docker Compose version v2.27.0

@davidhildebrand
Copy link

Upgrading docker-compose did the trick (after resolving some docker login issues that resulted from the upgrade). All set now, it seems. Thanks!

@Nini81
Copy link

Nini81 commented May 9, 2024

Same here, upgrading to latest docker-compose (2.27.0) and docker-ce (26.1.1) did the trick :
For Ubuntu / debian :

# Check the current version of Docker Compose
docker-compose version

# Backup 
cp /usr/local/bin/docker-compose /usr/local/bin/docker-compose.bck

# Download the latest version of Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

# Apply executable permissions to the binary
sudo chmod +x /usr/local/bin/docker-compose

# Verify the installation
docker-compose version

@ninji
Copy link

ninji commented May 16, 2024

Success

with following minor changes

  • installing docker-compose with the curl method above or via link above (https://docs.docker.com/compose/install/standalone/) and set the x bit, remove other distribution docker-composes (1.25.0-1, 1.27.x, 1.29.x) or make sure bitwarden.sh find the 2.27 in path
  • comment out the compose_version in bwdata/config.yml - it will be overwritten on next update

Environment

This work on the old 20.04 LTS Ubuntu on a VM.
This is essential because I have to maintain other self hosted instances without snapshot possibility for a rollback.
A update of docker.io (24.0.5) was not neccessary.

Tested on 22.04 LTS Ubuntu too. Same procedure.

Updated from 2024.4.0 -> 2024.5.0.

@Carded8521
Copy link

I tried commenting out compose_version in bwdata/config.yaml file and it worked. Also after update finished this property is gone from config so this should be only one-time workaround.

Hero! Worked for me too

@nkasco
Copy link

nkasco commented May 18, 2024

I tried commenting out compose_version in bwdata/config.yaml file and it worked. Also after update finished this property is gone from config so this should be only one-time workaround.

+1 worked for me too

@DNRK
Copy link

DNRK commented May 20, 2024

I tried commenting out compose_version in bwdata/config.yaml file and it worked. Also after update finished this property is gone from config so this should be only one-time workaround.

Thank you, worked for me

@Nurgus
Copy link

Nurgus commented Jul 18, 2024

None of the solutions here were suitable for me - my docker-compose.yml needs the version: "3" line and I don't want to use the curl solution to update docker-compose.

My workaround is to run bitwarden.sh update, observe the error message, add version: "3" to docker-compose.override.yml. The version line should be the same in both docker-compose.override.yml and docker-compose.yml.
Then run bitwarden.sh start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests