Skip to content
This repository has been archived by the owner on May 8, 2022. It is now read-only.

Fixed missing attributes required to create a user with Terraform #94

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

AnonymousWP
Copy link
Contributor

@AnonymousWP AnonymousWP commented Nov 25, 2021

Right now, Graylog expects a first name and last name, while the module still expects a full name. This PR could fix #91.

Right now, Graylog expects a first name and last name, while the module still expects a full name. This commit could fix terraform-provider-graylog#91.
@sollie
Copy link

sollie commented Nov 25, 2021

I believe this will break the provider for anyone using Graylog 4.0 or lower.
See https://docs.graylog.org/docs/changelog#graylog-410 and Graylog2/graylog2-server#10074

Would implementing a provider config flag like "graylog_min_version" and checking this respource.go solve that issue?

@AnonymousWP
Copy link
Contributor Author

AnonymousWP commented Nov 25, 2021

I believe this will break the provider for anyone using Graylog 4.0 or lower. See https://docs.graylog.org/docs/changelog#graylog-410 and Graylog2/graylog2-server#10074

Would implementing a provider config flag like "graylog_min_version" and checking this respource.go solve that issue?

Could be yeah, but I assume the majority of users is already on 4 (which has been released more than a year ago) and higher. Plus, if that's true, then it means that currently there are more people affected by the current situation than by the new situation (because the current situation impacts anyone Graylog 4.x, I believe.)

@sollie
Copy link

sollie commented Nov 25, 2021

From what I can read in the links above, this change came with 4.1.0.
Both graylog 4.0 and 3.3 has had updates in the last few months. 4.0.13 was released on 2021-09-13 and 3.3.14 was released on 2021-07-28.

@sollie
Copy link

sollie commented Nov 25, 2021

And, 4.1.0 is just a few months old itself, being released on 2021-06-23. So the issue probably affects fewer people than one might think.

@AnonymousWP
Copy link
Contributor Author

AnonymousWP commented Nov 25, 2021

Yeah you have a point there, but 4.1.0 has been released in June 2021, and you should consider all users from the version where people are impacted (so if I understood you correctly: 4.1.0) till the versions that have been published after 4.1.0. Assuming you meant only 4.1.0 itself; not the users that run versions later than that one.

@sollie
Copy link

sollie commented Dec 3, 2021

@suzuki-shunsuke Any chance you have time to look at this? This currently prevents me from fully deploying Graylog in my setup.

I think it needs some more work on tests, which could probably be pulled from https://github.com/sollie/terraform-provider-graylog/tree/support-first_name-and-last_name

I suspect the easiest way to prevent breaking other peoples setup is to release this as v1.1.0, hoping people don't randomly accept new minor versions.

@tboerger
Copy link

tboerger commented Dec 6, 2021

IMHO we got two options to handle this breaking change:

  1. Allow both fields, being it full_name and first/last name
  2. Drop full_name and add a note to the readme for version compatibality

Currently it is really a bad situation because we are not able to provision users for the recent version of Graylog.

@sollie
Copy link

sollie commented Feb 2, 2022

Tagging @suzuki-shunsuke again in the hopes he will notice this.

@AnonymousWP
Copy link
Contributor Author

Has this project been halted? At least a small announcement would be nice, so that we don't have to expect any new releases soon, or perhaps he's working on a rewrite (doubt it though).

@suzuki-shunsuke
Copy link
Member

suzuki-shunsuke commented Feb 2, 2022

@AnonymousWP @sollie

Sorry for late reply.

Unfortunately, it is difficult for me to maintain this project, because I no longer use Graylog.
I hope someone forks this repository and maintains it.

I'll update README and archive this repository. #97

@sollie
Copy link

sollie commented Mar 10, 2022

@suzuki-shunsuke Thanks for the update.
Could you consider pushing an update to the documentation on registry.terraform.io and/or the README.md about supporting user management on versions prior to 4.1 only? That would probably be beneficial for users coming here for help when it does not work on 4.1 or later.

@kdanielyan-ccl
Copy link

Hi @suzuki-shunsuke,
Are you going to merge the PR?
I am getting the following error on the Graylog version 4.2.3.

│ Error: status code: 400, {"type":"ApiError","message":"Cannot construct instance of org.graylog2.rest.models.users.requests.CreateUserRequest, problem: Null firstName\n at [Source: (org.glassfish.jersey.message.internal.ReaderInterceptorExecutor$UnCloseableInputStream); line: 1, column: 223]"}: status code >= 300 │ │ with module.user["test"].graylog_user.default, │ on ../../../../modules/graylog/user/main.tf line 5, in resource "graylog_user" "default": │ 5: resource "graylog_user" "default" {

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

Successfully merging this pull request may close these issues.

400 Error when creating a user
5 participants