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

[Alfresco] After restarting the machine the searches (SOLR) do not work. #877

Closed
evaristorivi opened this issue Apr 27, 2023 · 10 comments
Closed
Assignees
Labels
alfresco solved stale 15 days without activity tech-issues The user has a technical issue about an application triage Triage is needed

Comments

@evaristorivi
Copy link

evaristorivi commented Apr 27, 2023

Platform

AWS

bndiagnostic ID know more about bndiagnostic ID

032b192a-77d9-7b4b-7508-7aa619a8957f

bndiagnostic output

[Thu Apr 27 18:26:07.282749 2023] [auth_basic:error] [pid 40713:tid
140373632386816] [client **ip_address**:39060] AH01617: user admin:
authentication failure for "/solr/": Password Mismatch

[Thu Apr 27 18:29:34.969747 2023] [proxy:error] [pid 39110:tid 140373741491968]
(111)Connection refused: AH00957: http: attempt to connect to
**ip_address**:8983 (127.0.0.1:8983) failed

bndiagnostic was not useful. Could you please tell us why?

the problem persists.

Describe your issue as much as you can

Searches do not work and this log error appears after rebooting the machine:

        ... 1 more
2023-04-27 19:03:41,803  ERROR [extensions.webscripts.AbstractRuntime] [http-nio-8080-exec-10] Exception from executeScript: 03270003 Wrapped Exception (with status template): 03270047 Failed to execute s
cript 'classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/doclist.get.js': 03270046 Failed to execute search:  +@cm\:modified:[2023\-4\-20T00\:00\:00.000 TO 2023\-4\-27T23\:59
\:59.999] +@cm\:modifier:"admin" +TYPE:"cm:content" -TYPE:"cm:systemfolder" -TYPE:"fm:forums" -TYPE:"fm:forum" -TYPE:"fm:topic" -TYPE:"fm:post" +(TYPE:"content" OR TYPE:"app:filelink" OR TYPE:"folder")
org.springframework.extensions.webscripts.WebScriptException: 03270003 Wrapped Exception (with status template): 03270047 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/sl
ingshot/documentlibrary/doclist.get.js': 03270046 Failed to execute search:  +@cm\:modified:[2023\-4\-20T00\:00\:00.000 TO 2023\-4\-27T23\:59\:59.999] +@cm\:modifier:"admin" +TYPE:"cm:content" -TYPE:"cm:s
ystemfolder" -TYPE:"fm:forums" -TYPE:"fm:forum" -TYPE:"fm:topic" -TYPE:"fm:post" +(TYPE:"content" OR TYPE:"app:filelink" OR TYPE:"folder")
        at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1139)
        at org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:171)
        at org.alfresco.repo.web.scripts.RepositoryContainer.lambda$transactionedExecute$2(RepositoryContainer.java:553)
@evaristorivi evaristorivi added the tech-issues The user has a technical issue about an application label Apr 27, 2023
@github-actions github-actions bot added the triage Triage is needed label Apr 27, 2023
@gongomgra
Copy link
Collaborator

Hi @evaristorivi,

Thanks for using Bitnami. According to the bndiagnostic output your shared, you are using our Alfresco image 7.3.1-20, but I see we have recently released a couple of extra revisions, and that 7.3.1-22 is the latest image available as you can check in our website. Can you try the latest image in case the issue is solved? If not, can you please give us more details on how to reproduce the issue? Is it only needed to launch a fresh new server and once it has been fully initialized, restarting the machine causes the error?

@evaristorivi
Copy link
Author

evaristorivi commented May 3, 2023

Hello @gongomgra ,
To reproduce the error, just launch the most current bitnami alfresco image of aws, and once deployed, do a migration from an alfresco running on another machine, just the data and keystore, and reboot the machine.

but I have solved it. I had two problems.
On the one hand, we had a problem with the bitnami script that raises the solr service.
In /opt/bitnami/scripts/libalfresco.sh


is_alfresco_search_services_running() {
    local status
    status=$("${ALFRESCO_SEARCH_SERVICES_BASE_DIR}/solr/bin/solr" status)
    local regex
    regex=".*Solr process.*"
    if [[ "$status" =~ $regex ]]; then
        true
    else
        false
    fi
}

${ALFRESCO_SEARCH_SERVICES_BASE_DIR}/solr/bin/solr" status gave a random false positive:
Found 1 Solr nodes: Solr process 28130 from /opt/bitnami/alfresco-search-services/solr/bin/solr-8983.pid not found.
and this made bitnami think that the service was running, so after a restart of the machine, it never got solr up.

The fix has been to change the function to:

is_alfresco_search_services_running() {
    local status
    status=$("${ALFRESCO_SEARCH_SERVICES_BASE_DIR}/solr/bin/solr" status)
    local regex
    regex=".*Solr process.*"
    real_status=$(ps -ef | grep solr | grep -v grep)
    if [ $? -eq 0 ]; then
        true
    else
        false
    fi
}

This way it always recognises correctly whether it is running or not.
now the start and status scripts inside /opt/bitnami/scripts/alfresco-search-services work correctly.

On the other hand, in order for the communication between solr and alfresco to work correctly, they need to know the secret that is in /opt/bitnami/tomcat/shared/classes/alfresco-global.properties
solr.sharedSecret=*******

But solr didn't know which one was alfresco.
I have edited /opt/bitnami/scripts/alfresco-env.sh
and I have changed
export ALFRESCO_SEARCH_SERVICE_SECRET="${ALFRESCO_SEARCH_SERVICE_SECRET:-bitnami}"
by
export ALFRESCO_SEARCH_SERVICE_SECRET="*******************************"

@gongomgra
Copy link
Collaborator

Hi @evaristorivi,

Sorry for the delay on getting back to this. Thank you so much for your investigation and for sharing your solution with us. I'm glad you could make your Alfresco application properly work. I have just filed an internal task for our engineering team to fix the issues you shared. They will keep this ticket updated, and in the meantime I will move it to on-hold status for the stale bot not to close it automatically.

@victorcarabez
Copy link

Hello @gongomgra , To reproduce the error, just launch the most current bitnami alfresco image of aws, and once deployed, do a migration from an alfresco running on another machine, just the data and keystore, and reboot the machine.

but I have solved it. I had two problems. On the one hand, we had a problem with the bitnami script that raises the solr service. In /opt/bitnami/scripts/libalfresco.sh


is_alfresco_search_services_running() {
    local status
    status=$("${ALFRESCO_SEARCH_SERVICES_BASE_DIR}/solr/bin/solr" status)
    local regex
    regex=".*Solr process.*"
    if [[ "$status" =~ $regex ]]; then
        true
    else
        false
    fi
}

${ALFRESCO_SEARCH_SERVICES_BASE_DIR}/solr/bin/solr" status gave a random false positive: Found 1 Solr nodes: Solr process 28130 from /opt/bitnami/alfresco-search-services/solr/bin/solr-8983.pid not found. and this made bitnami think that the service was running, so after a restart of the machine, it never got solr up.

The fix has been to change the function to:

is_alfresco_search_services_running() {
    local status
    status=$("${ALFRESCO_SEARCH_SERVICES_BASE_DIR}/solr/bin/solr" status)
    local regex
    regex=".*Solr process.*"
    real_status=$(ps -ef | grep solr | grep -v grep)
    if [ $? -eq 0 ]; then
        true
    else
        false
    fi
}

This way it always recognises correctly whether it is running or not. now the start and status scripts inside /opt/bitnami/scripts/alfresco-search-services work correctly.

On the other hand, in order for the communication between solr and alfresco to work correctly, they need to know the secret that is in /opt/bitnami/tomcat/shared/classes/alfresco-global.properties solr.sharedSecret=*******

But solr didn't know which one was alfresco. I have edited /opt/bitnami/scripts/alfresco-env.sh and I have changed export ALFRESCO_SEARCH_SERVICE_SECRET="${ALFRESCO_SEARCH_SERVICE_SECRET:-bitnami}" by export ALFRESCO_SEARCH_SERVICE_SECRET="*******************************"

The second workaround described in "On the other hand, in order for the communication between solr and alfresco to work correctly..." doesn't works in a bitnami VM image bitnami-alfresco-7.4.0-r0-debian-11-amd64.ova nor bitnami-alfresco-7.4.0-r1-debian-11-amd64.ova

When check status sudo /opt/bitnami/alfresco-search-services/solr/bin/solr status, it returns:
Found 1 Solr nodes:

Solr process 1761 running on port 8983

ERROR: Failed to get system information from http://localhost:8983/solr due to: org.apache.http.client.ClientProtocolException: Expected JSON response from server but received:
HTTP ERROR 403
Problem accessing /solr/admin/info/system. Reason:
Authentication failure: secret method has been selected, use the right request header with the secret word

The /opt/bitnami/scripts/alfresco-env.sh file has been changed:

# Search Services configuration
export ALFRESCO_SOLR_HOST="${ALFRESCO_SOLR_HOST:-localhost}"
export ALFRESCO_SOLR_PORT="${ALFRESCO_SOLR_PORT:-8983}"
ALFRESCO_SECRET="${ALFRESCO_SECRET:-"${ALFRESCO_SEARCH_SERVICE_SECRET:-}"}"
export ALFRESCO_SECRET="${ALFRESCO_SECRET:-bitnami}"

@github-actions github-actions bot added triage Triage is needed and removed on-hold Issues or Pull Requests with this label will never be considered stale labels Jul 1, 2023
@mdhont
Copy link

mdhont commented Jul 5, 2023

Thanks for the extra information. I will update the information in the task as well.

@rafariossaa
Copy link

Hi @victorcarabez ,
Now that you have the workaround, would you like to contribute and send a PR implementing those changes ? We will be glad to review and merge it.

@evaristorivi
Copy link
Author

@victorcarabez

The second solution described in "On the other hand, for the communication between solr and alfresco to work correctly..." did not work for me if the first solution was not applied first, otherwise the error would indeed appear
Found 1 Solr nodes:
Solr process 1761 running on port 8983

so in my case I had to apply both solutions, not one of the two.

@gongomgra
Copy link
Collaborator

Hi @evaristorivi,

Thanks for sharing your solution. I'm sure it will be of help to other users in the future.

@github-actions
Copy link

This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.

@github-actions github-actions bot added the stale 15 days without activity label Jul 28, 2023
@github-actions
Copy link

github-actions bot commented Aug 3, 2023

Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.

@github-actions github-actions bot added the solved label Aug 3, 2023
@bitnami-bot bitnami-bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alfresco solved stale 15 days without activity tech-issues The user has a technical issue about an application triage Triage is needed
Projects
None yet
Development

No branches or pull requests

6 participants