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

Cannot handle configuration string over 65535 characters long #328

Closed
Nuru opened this issue Apr 14, 2020 · 8 comments
Closed

Cannot handle configuration string over 65535 characters long #328

Nuru opened this issue Apr 14, 2020 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@Nuru
Copy link

Nuru commented Apr 14, 2020

Using operator v0.4.0 with
I tried to set the cssText field for simple-theme-plugin via Configuration as Code, but it choked because the field was too big. I don't know if this is an error in the kubernetes-operator or the configuration-as-code-plugin, but it is a Groovy script error, so I am guessing the bug report belongs here.

 controller-jenkins      groovy/groovy.go:57     user-casc Source 'jenkins-plugins-configuration' Name 'simple-th
eme-plugin-configuration.yaml' groovy script execution failed, logs :
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script1.groovy: 2: String too long. The given string is 131529 Unicode code units long, but only a maximum of 65535 is allowed.
 @ line 2, column 14.
   def config = '''
                ^
@tomaszsek tomaszsek added the bug Something isn't working label Apr 14, 2020
@tomaszsek
Copy link

@Nuru,

I think the problem is on the operator side. I have to do some research on how we can solve it.

Cheers

@waveywaves
Copy link
Member

@Nuru What is the cssText that you were passing ?

@waveywaves
Copy link
Member

@tomaszsek in /pkg/controller/jenkins/configuration/user/casc/caac.go the CASCscript is created using applyConfigurationAsCodeGroovyScriptFmt.

const applyConfigurationAsCodeGroovyScriptFmt = `
def config = '''
%s
'''
def stream = new ByteArrayInputStream(config.getBytes('UTF-8'))

def source = new io.jenkins.plugins.casc.yaml.YamlSource(stream, io.jenkins.plugins.casc.yaml.YamlSource.READ_FROM_INPUTSTREAM)
io.jenkins.plugins.casc.ConfigurationAsCode.get().configureWith(source)
`

The error is happening at stream where the configuration seems to have gotten too big.
@Nuru Can you help with the cssText argument you are passing for this ? It would be easier to help you out

@Nuru
Copy link
Author

Nuru commented Apr 15, 2020

@waveywaves The exact contents of the cssText field is not important, only its length. You can use, for example, http://afonsof.com/jenkins-material-theme/dist/material-light.css

mkarebski pushed a commit to mkarebski/kubernetes-operator that referenced this issue Apr 24, 2020
mkarebski pushed a commit to mkarebski/kubernetes-operator that referenced this issue Apr 24, 2020
tomaszsek added a commit that referenced this issue Apr 24, 2020
#328 Fix 65535 string length issue
akram pushed a commit to akram/jenkins-operator that referenced this issue May 6, 2020
akram pushed a commit to akram/jenkins-operator that referenced this issue May 6, 2020
@Nuru
Copy link
Author

Nuru commented Jun 10, 2020

@tomaszsek See also jenkinsci/configuration-as-code-plugin#1398 (comment) (operator breaks under current CAC 1.41)

@tomaszsek
Copy link

Hi @Nuru,

The fix is merged to the master and will be added in the next release.

Cheers

@sboardwell
Copy link

Hi @tomaszsek, could you tell me when the next release is going to be please?

@tomaszsek
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants