Cannot create OSS bucket. Repeating
Opened this issue · 4 comments
Trying to build for the first time and getting the error "Cannot create OSS bucket. Repeating" a few times then crashes. Curious if anyone was able to resolve this issue.
System.AggregateException: One or more errors occurred. (Error calling CreateBucket: {"reason":"Bucket already exists"})
---> Autodesk.Forge.Client.ApiException: Error calling CreateBucket: {"reason":"Bucket already exists"}
This seems you need to do fresh initialization. Can you run dotnet run initialize=true clear=true
.
@mivasi I actually fixed it by recreating a forge app. Im at a loss at what actually fixed it or what the issue was lol
Let me explain what may happen. OSS bucket is place where you place all the data for configurator. Bucket name has to be unique across whole Autodesk system. We are using Forge App ID to create the name of the bucket. In case you already came trough the initialization your bucket was already created. Command dotnet run initialize=true
is always creating whole environments (which means it always create the bucket. It is not asking if it already exists. It just tries to create it and fail if it already exists). You were basically initializing for 2nd time, and that was the cause. What to do with the situation of having bucket already existing depends on what you are trying to achieve by 2nd initialization.
- If you are playing with the application and you are trying to upload new appbundles and in the same time you want to keep all data inside the bucket, you can reinitialize using
dotnet run bundles=true
- If you feel like your initialization failed first time, and so you are doing it for second time, probably at least bucket was already created and you want to clear your app completely before doing initialization again. And for that we have
dotnet run initialize=true clear=true
. It will first clear everything before doing initialization.
I would guess, that the problem is caused by the old OSS issue related to the bucket deletion. Sometimes are buckets not deleted properly and the same bucket cannot be created again. We have encounter this problem several times, so we have introduced the configuration variable BucketSuffix
. When you set this using environment variable
or appsettings.json
, the app will add a string defined by this variable to the Bucket name. When you do so you can stay on the same ForgeID
, just effectively use different bucket in the app.