arquillian / arquillian.github.io

Arquillian website source (develop branch) and hosting (master branch). Baked with Awestruct.
http://arquillian.org
Other
78 stars 147 forks source link

fix: nil references while generating content #438

Closed gpoul closed 4 years ago

gpoul commented 6 years ago

While building from an empty docker container I had several nil reference issues; potentially because I don't have authorization to view the github teams. These code changes address those issues.

MatousJobanek commented 6 years ago

Hi @gpoul, if you are referring to these error messages https://travis-ci.org/arquillian/arquillian.github.io/builds/369830406#L1655-L1657 then, to be honest, I have no idea what the problem is. As you can see, the same error message is visible also for the travis build although there are used authenticated request with the correct permissions. The cause could be also on the side of GitHub (getting 404 from GH is not really rare)- at least, the build for the develop branch has passed a few minutes ago. I have restarted the build for your second PR, so (hopefully) it will green :-)

gpoul commented 6 years ago

No, the ones I fixed in this PR caused my local awestruct build to completely fail while executing the pipeline... I guess because of missing data; not sure why, really. Maybe you can tell based on the fields that were missing?

On Mon, Apr 23, 2018 at 6:55 PM Matous Jobanek notifications@github.com wrote:

Hi @gpoul https://github.com/gpoul, if you are referring to these error messages https://travis-ci.org/arquillian/arquillian.github.io/builds/369830406#L1655-L1657 then, to be honest, I have no idea what the problem is. As you can see, the same error message is visible also for the travis build although there are used authenticated request with the correct permissions. The cause could be also on the side of GitHub (getting 404 from GH is not really rare)- at least, the build for the develop branch has passed a few minutes ago. I have restarted the build for your second PR, so (hopefully) it will green :-)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arquillian/arquillian.github.io/pull/438#issuecomment-383646494, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJ3Wqdgms9da3cs0m7mA2vcMJkbPjOwks5trgeUgaJpZM4Te_PF .

MatousJobanek commented 6 years ago

So, would you mind to share with me the error you were facing? There is another (for me) well known issue:

While processing file 
An error occurred: undefined method `username' for nil:NilClass
/home/dev/arquillian.github.io/_ext/releases.rb:80:in `block (2 levels) in execute'
/home/dev/arquillian.github.io/_ext/releases.rb:32:in `each'
/home/dev/arquillian.github.io/_ext/releases.rb:32:in `block in execute'
/home/dev/arquillian.github.io/_ext/releases.rb:27:in `each'
/home/dev/arquillian.github.io/_ext/releases.rb:27:in `execute'
/home/dev/awestruct/lib/awestruct/pipeline.rb:81:in `block in execute_extensions'
/home/dev/awestruct/lib/awestruct/pipeline.rb:73:in `each'
/home/dev/awestruct/lib/awestruct/pipeline.rb:73:in `execute_extensions'
/home/dev/awestruct/lib/awestruct/pipeline.rb:51:in `execute'
/home/dev/awestruct/lib/awestruct/engine.rb:312:in `execute_pipeline'
/home/dev/awestruct/lib/awestruct/engine.rb:94:in `run'
/home/dev/awestruct/lib/awestruct/cli/generate.rb:22:in `run'
/home/dev/awestruct/lib/awestruct/cli/invoker.rb:152:in `invoke_generate'
/home/dev/awestruct/lib/awestruct/cli/invoker.rb:74:in `invoke!'
/home/dev/awestruct/bin/awestruct:9:in `<top (required)>'
/home/dev/.rvm/gems/ruby-2.3.1/bin/awestruct:23:in `load'
/home/dev/.rvm/gems/ruby-2.3.1/bin/awestruct:23:in `<main>'
/home/dev/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'
/home/dev/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'

this happens when the generation process fails in the middle (because of any issue) and you restart the process again. Then it takes some invalid state of the identities and fails with the error above. To avoid this error it is necessary to remove at least _tmp/datacache/ directory or the whole _tmp directory and start the process again. The reason why I'm asking is that with the latest fix/workaround you shouldn't need any additional permission to build the blog locally - I have just tried it with a brand new test account that is not part of any organization and the build has passed. Sure, there could be visible some warnings but for the local setup, it should be fine.

gpoul commented 6 years ago

I've now cleaned _tmp completely and re-run within the docker container and get the error below; this is not one I fixed, though and I haven't yet looked into it; seems like this is still a somewhat moving target :-/

While processing file An error occurred: undefined method `response' for

Did you mean? respond_to? /home/dev/arquillian.github.io/_ext/restclient_extensions.rb:56:in rescue in execute' /home/dev/arquillian.github.io/_ext/restclient_extensions.rb:50:inexecute' /home/dev/.rvm/gems/ruby-2.3.1/gems/rest-client-2.0.2/lib/restclient/request.rb:52:in execute' /home/dev/.rvm/gems/ruby-2.3.1/gems/rest-client-2.0.2/lib/restclient.rb:67:in get' /home/dev/arquillian.github.io/_ext/identities/confluence.rb:42:in block in crawl' /home/dev/arquillian.github.io/_ext/identities/confluence.rb:32:ineach' /home/dev/arquillian.github.io/_ext/identities/confluence.rb:32:in crawl' /home/dev/arquillian.github.io/_ext/identities.rb:192:inblock (2 levels) in execute' /home/dev/arquillian.github.io/_ext/identities.rb:191:in each' /home/dev/arquillian.github.io/_ext/identities.rb:191:inblock in execute' /home/dev/arquillian.github.io/_ext/identities.rb:190:in each' /home/dev/arquillian.github.io/_ext/identities.rb:190:inexecute' /home/dev/awestruct/lib/awestruct/pipeline.rb:81:in block in execute_extensions' /home/dev/awestruct/lib/awestruct/pipeline.rb:73:ineach' /home/dev/awestruct/lib/awestruct/pipeline.rb:73:in execute_extensions' /home/dev/awestruct/lib/awestruct/pipeline.rb:51:inexecute' /home/dev/awestruct/lib/awestruct/engine.rb:312:in execute_pipeline' /home/dev/awestruct/lib/awestruct/engine.rb:94:inrun' /home/dev/awestruct/lib/awestruct/cli/generate.rb:22:in run' /home/dev/awestruct/lib/awestruct/cli/invoker.rb:152:ininvoke_generate' /home/dev/awestruct/lib/awestruct/cli/invoker.rb:74:in invoke!' /home/dev/awestruct/bin/awestruct:9:in<top (required)>' /home/dev/.rvm/gems/ruby-2.3.1/bin/awestruct:23:in load' /home/dev/.rvm/gems/ruby-2.3.1/bin/awestruct:23:in

' /home/dev/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in eval' /home/dev/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in
'

On Tue, Apr 24, 2018 at 9:56 AM Matous Jobanek notifications@github.com wrote:

So, would you mind to share with me the error you were facing? There is another (for me) well known issue:

While processing file An error occurred: undefined method username' for nil:NilClass /home/dev/arquillian.github.io/_ext/releases.rb:80:inblock (2 levels) in execute' /home/dev/arquillian.github.io/_ext/releases.rb:32:in each' /home/dev/arquillian.github.io/_ext/releases.rb:32:inblock in execute' /home/dev/arquillian.github.io/_ext/releases.rb:27:in each' /home/dev/arquillian.github.io/_ext/releases.rb:27:inexecute' /home/dev/awestruct/lib/awestruct/pipeline.rb:81:in block in execute_extensions' /home/dev/awestruct/lib/awestruct/pipeline.rb:73:ineach' /home/dev/awestruct/lib/awestruct/pipeline.rb:73:in execute_extensions' /home/dev/awestruct/lib/awestruct/pipeline.rb:51:inexecute' /home/dev/awestruct/lib/awestruct/engine.rb:312:in execute_pipeline' /home/dev/awestruct/lib/awestruct/engine.rb:94:inrun' /home/dev/awestruct/lib/awestruct/cli/generate.rb:22:in run' /home/dev/awestruct/lib/awestruct/cli/invoker.rb:152:ininvoke_generate' /home/dev/awestruct/lib/awestruct/cli/invoker.rb:74:in invoke!' /home/dev/awestruct/bin/awestruct:9:in<top (required)>' /home/dev/.rvm/gems/ruby-2.3.1/bin/awestruct:23:in load' /home/dev/.rvm/gems/ruby-2.3.1/bin/awestruct:23:in

' /home/dev/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in eval' /home/dev/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in
'

this happens when the generation process fails in the middle (because of any issue) and you restart the process again. Then it takes some invalid state of the identities and fails with the error above. To avoid this error it is necessary to remove at least _tmp/datacache/ directory or the whole _tmp directory and start the process again. The reason why I'm asking is that with the latest fix/workaround https://github.com/arquillian/arquillian.github.io/commit/0b653c4c03ad90817e897f2a998816a63fa93dea you shouldn't need any additional permission to build the blog locally - I have just tried it with a brand new test account that is not part of any organization and the build has passed. Sure, there could be visible some warnings but for the local setup, it should be fine.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/arquillian/arquillian.github.io/pull/438#issuecomment-383839126, or mute the thread https://github.com/notifications/unsubscribe-auth/AAJ3Wv1x4LW1DpkirBIYSGXEtCwYx0fAks5trtrHgaJpZM4Te_PF .