Tridion UGC comment shows author as null - tridion
I have configured Tridion for User Generated content, and created a web page using the default/demo template, which uses a text input field to provide the name of the Comment's author. The comments are accepted, but when displayed they show the name of the user as "null". I believe the problem is in storing the name, not in retrieving it. If I create a comment from within the Content Manager UI, and then return to my test web page, the comment is shown, with the name of the moderator.
The public-facing UGC web service has the AllowAnonymousClaimProcessor configured. (Without this, the comment isn't saved at all.) The logging shows this apparently successfully transforming the missing taf:claim:contentdelivery:webservice:user into one based on a tracking id.
Of course, the idea is not to use this as the author of the comment. In the logging you can also see the string "Test User" coming from the text input in the web page, and that this seems to be mapped on to author=com.tridion.storage.ugc.UGCUser#2598a35d, but that shortly afterwards the storage layer searches for a user with ID null and finds one.
I suspect this is a configuration issue, but as you can see, it is complex, and I'm not really sure where to look further. Explanations of how it is supposed to work would be just as welcome as more concrete suggestions of experiments to proceed with.
The logging output follows. I've trimmed it a lot but it's still pretty long as I don't know which bits might prove relevant:
2012-06-03 13:00:10,662 WARN AmbientDataContext - There is no current ambient data context - the ambient data framework is not properly initialised
2012-06-03 13:00:10,668 DEBUG AmbientDataContext - Setting current ambient data context: com.tridion.ambientdata.web.WebContext
2012-06-03 13:00:10,903 DEBUG ClaimStore - put: uri=taf:response:cookie:generation, value=true
2012-06-03 13:00:10,906 DEBUG WebContext - setCurrentClaimStore: com.tridion.ambientdata.dotnet.DotNetClaimStore#483a0ab1, thread: Thread-1
2012-06-03 13:00:10,922 DEBUG ClaimStore - put: uri=taf:request:uri, value=/odata.svc/ItemStats(PublicationId=19,Id=320,Type=16)
2012-06-03 13:00:10,923 DEBUG ClaimStore - put: uri=taf:request:full_url, value=http://cdweb.visitorsweb.local/odata.svc/ItemStats(PublicationId=19,Id=320,Type=16)
2012-06-03 13:00:10,936 DEBUG ClaimStore - put: uri=taf:request:headers, value={content-type=[Ljava.lang.String;#5a940f82, connection=[Ljava.lang.String;#2e864e43, host=[Ljava.lang.String;#737c2891, accept=[Ljava.lang.String;#5c4b82d2}
2012-06-03 13:00:10,937 DEBUG ClaimStore - put: uri=taf:request:cookies, value={}
2012-06-03 13:00:10,937 DEBUG ClaimStore - put: uri=taf:request:parameters, value={CONTENT_TYPE=[Ljava.lang.String;#6179d854, QUERY_STRING=[Ljava.lang.String;#669a4cb}
2012-06-03 13:00:10,938 DEBUG ClaimStore - put: uri=taf:server:variables, value={REMOTE_USER=, PATH_TRANSLATED=C:\inetpub\LiveCDService\odata.svc, SERVER_PORT=80, SCRIPT_NAME=/odata.svc, REMOTE_ADDR=127.0.0.1, AUTH_TYPE=, SERVER_PROTOCOL=HTTP/1.1, REQUEST_METHOD=GET, DOCUMENT_ROOT=C:\inetpub\LiveCDService, REMOTE_HOST=127.0.0.1, SERVER_NAME=cdweb.visitorsweb.local, SECURE=false}
2012-06-03 13:00:10,943 DEBUG ClaimStore - put: uri=taf:session:id, value=tridion_1d6b8066-4b45-4047-bf63-521eaeadb439
2012-06-03 13:00:10,944 DEBUG ClaimStore - put: uri=taf:tracking:id, value=tridion_52d4956c-ae40-4c97-8eea-62d8ef7daa4c
2012-06-03 13:00:10,953 DEBUG ClaimStore - put: uri=taf:session:attributes, value={Tridion.ContentDelivery.AmbientData.ClaimStore=Tridion.ContentDelivery.AmbientData.ClaimStore}
2012-06-03 13:00:10,954 DEBUG AllowAnonymousPostClaimProcessor - No external user specified, using tracking id.
2012-06-03 13:00:10,954 DEBUG ClaimStore - put: uri=taf:claim:contentdelivery:webservice:user, value=tridion_52d4956c-ae40-4c97-8eea-62d8ef7daa4c
2012-06-03 13:00:10,964 DEBUG ClaimStore - put: uri=taf:claim:contentdelivery:webservice:post:allowed, value=false
2012-06-03 13:00:11,275 DEBUG ODataService - ODATA.NET: Resource retrieval: ItemStats(PublicationId=19,Id=320,Type=16)
2012-06-03 13:00:11,276 DEBUG WebContext - setCurrentClaimStore: com.tridion.ambientdata.dotnet.DotNetClaimStore#483a0ab1, thread: Thread-2
2012-06-03 13:00:11,289 DEBUG ODataWebserviceHandler - Requested a OData feed/entry: ItemStats(PublicationId=19,Id=320,Type=16) with type: application/json
2012-06-03 13:00:11,289 DEBUG ODataWebserviceHandler - Setting $top to 25
2012-06-03 13:00:11,291 DEBUG ResolverBase - Requested specific OData Entry
2012-06-03 13:00:13,774 DEBUG PooledDataSourceBeanConfigurer - Initializing Pooled data source
... snip
2012-06-03 13:00:13,774 DEBUG EntityManagerFactoryBeanConfigurer - Registering EntityManagerFactory to Spring Context
2012-06-03 13:00:13,778 INFO SpringConfigurationLoader - Finished loading spring application context
2012-06-03 13:00:13,778 INFO ConfigurationStepLoader - Executing configuration step: BundleLoader
2012-06-03 13:00:13,787 INFO BundleConfigurationLoader - Custom storage bindings defined, loading ugc_dao_bundle.xml
2012-06-03 13:00:13,971 INFO BundleConfigurationLoader - Added 'Comment' for storage 'persistence' with 'com.tridion.storage.ugc.dao.persistence.JPACommentDAO'.
2012-06-03 13:00:13,978 INFO BundleConfigurationLoader - Added 'Rating' for storage 'persistence' with 'com.tridion.storage.ugc.dao.persistence.JPARatingDAO'.
2012-06-03 13:00:13,989 INFO BundleConfigurationLoader - Added 'UGCUser' for storage 'persistence' with 'com.tridion.storage.ugc.dao.persistence.JPAUserDAO'.
2012-06-03 13:00:13,995 INFO BundleConfigurationLoader - Added 'UGCItemStats' for storage 'persistence' with 'com.tridion.storage.ugc.dao.persistence.JPAItemStatsDAO'.
2012-06-03 13:00:14,002 INFO ConfigurationStepLoader - Executing configuration step: FactoryLoader
2012-06-03 13:00:25,550 DEBUG ClaimStore - put: uri=taf:response:cookie:generation, value=true
2012-06-03 13:00:25,550 DEBUG WebContext - setCurrentClaimStore: com.tridion.ambientdata.dotnet.DotNetClaimStore#5e7b4ed7, thread: Thread-1
2012-06-03 13:00:25,550 DEBUG ClaimStore - put: uri=taf:request:uri, value=/odata.svc/Comments
2012-06-03 13:00:25,551 DEBUG ClaimStore - put: uri=taf:request:full_url, value=http://cdweb.visitorsweb.local/odata.svc/Comments
2012-06-03 13:00:25,551 DEBUG ClaimStore - put: uri=taf:request:headers, value={expect=[Ljava.lang.String;#717535b6, content-type=[Ljava.lang.String;#461979eb, connection=[Ljava.lang.String;#32935741, host=[Ljava.lang.String;#67458657, accept=[Ljava.lang.String;#576eeb9, content-length=[Ljava.lang.String;#4332b67c}
2012-06-03 13:00:25,551 DEBUG ClaimStore - put: uri=taf:request:cookies, value={}
2012-06-03 13:00:25,552 DEBUG ClaimStore - put: uri=taf:request:parameters, value={CONTENT_TYPE=[Ljava.lang.String;#366aa95b, QUERY_STRING=[Ljava.lang.String;#1494b146}
2012-06-03 13:00:25,552 DEBUG ClaimStore - put: uri=taf:server:variables, value={REMOTE_USER=, PATH_TRANSLATED=C:\inetpub\LiveCDService\odata.svc, SERVER_PORT=80, SCRIPT_NAME=/odata.svc, REMOTE_ADDR=127.0.0.1, AUTH_TYPE=, SERVER_PROTOCOL=HTTP/1.1, REQUEST_METHOD=POST, DOCUMENT_ROOT=C:\inetpub\LiveCDService, REMOTE_HOST=127.0.0.1, SERVER_NAME=cdweb.visitorsweb.local, SECURE=false}
2012-06-03 13:00:25,553 DEBUG ClaimStore - put: uri=taf:session:id, value=tridion_d56681a1-15aa-4eed-acdf-e6c82e6a9488
2012-06-03 13:00:25,553 DEBUG ClaimStore - put: uri=taf:tracking:id, value=tridion_79775c4b-54fe-4d5c-875d-bc0354ea77c3
2012-06-03 13:00:25,553 DEBUG ClaimStore - put: uri=taf:session:attributes, value={Tridion.ContentDelivery.AmbientData.ClaimStore=Tridion.ContentDelivery.AmbientData.ClaimStore}
2012-06-03 13:00:25,553 DEBUG AllowAnonymousPostClaimProcessor - No external user specified, using tracking id.
2012-06-03 13:00:25,553 DEBUG ClaimStore - put: uri=taf:claim:contentdelivery:webservice:user, value=tridion_79775c4b-54fe-4d5c-875d-bc0354ea77c3
2012-06-03 13:00:25,555 DEBUG ClaimStore - put: uri=taf:claim:contentdelivery:webservice:post:allowed, value=true
2012-06-03 13:00:25,563 DEBUG ODataService - ODATA.NET: Inserting entity on path: Comments
2012-06-03 13:00:25,563 DEBUG WebContext - setCurrentClaimStore: com.tridion.ambientdata.dotnet.DotNetClaimStore#5e7b4ed7, thread: Thread-6
2012-06-03 13:00:25,568 DEBUG WritableCommentEntryService - Parsing comment: {d:{"Id":0,"ItemPublicationId":19,"ItemId":320,"ItemType":16,"CreationDate":"\/Date(1338728425535+120)\/","LastModifiedDate":"\/Date(1338728425535+120)\/","User":{"Id":null,"Name":"Test Name","EmailAddress":"test#email.com","ExternalId":null},"Content":"This is a test comment, which will probably appear to be anonymous","Moderator":null,"ModeratedDate":null,"Score":0,"Status":0}}.
2012-06-03 13:00:25,582 DEBUG UGCConfigurationLoader - Attempt loading default storage configuration file
2012-06-03 13:00:25,671 DEBUG WritableCommentEntryService - Storing comment: Comment [commentId=0, content=This is a test comment, which will probably appear to be anonymous, itemPublicationId=19, itemId=320, itemType=16, author=com.tridion.storage.ugc.UGCUser#2598a35d, creationDate=Sun Jun 03 15:00:25 CEST 2012, lastModifiedDate=Sun Jun 03 15:00:25 CEST 2012, moderatedDate=null, moderator=null, score=0, status=0].
2012-06-03 13:00:31,952 DEBUG JPADAOFactory - Loaded BinaryDAO for storageId: defaultdb
2012-06-03 13:00:31,971 DEBUG JPADAOFactory - Loaded BinaryMetaDAO for storageId: defaultdb
2012-06-03 13:00:34,260 DEBUG JPADAOFactory - Loaded TrackedPageDAO for storageId: ugcdb
...snip
2012-06-03 13:00:34,260 DEBUG JPADAOFactory - Loaded XSLTDAO for storageId: ugcdb
2012-06-03 13:00:34,260 DEBUG JPADAOFactory - Loaded CommentDAO for storageId: ugcdb
2012-06-03 13:00:34,261 DEBUG JPADAOFactory - Loaded RatingDAO for storageId: ugcdb
2012-06-03 13:00:34,261 DEBUG JPADAOFactory - Loaded UGCUserDAO for storageId: ugcdb
2012-06-03 13:00:34,261 DEBUG JPADAOFactory - Loaded UGCItemStatsDAO for storageId: ugcdb
2012-06-03 13:00:34,261 INFO ConfigurationStepLoader - Executing configuration step: TypeMappingCheckLoader
2012-06-03 13:00:34,266 INFO ConfigurationStepLoader - Executing configuration step: ConfigurationItemTypeLoader
2012-06-03 13:00:34,270 INFO ConfigurationItemTypeLoader - Loaded default storage: brokerdb
2012-06-03 13:00:34,270 DEBUG ConfigurationItemTypeLoader - Loading default global typeMappings
2012-06-03 13:00:34,270 DEBUG ConfigurationItemTypeLoader - Loaded mapping: page to storage: brokerdb
2012-06-03 13:00:34,270 DEBUG ConfigurationItemTypeLoader - Loaded mapping: comment to storage: ugcdb
2012-06-03 13:00:34,270 DEBUG ConfigurationItemTypeLoader - Loaded mapping: rating to storage: ugcdb
2012-06-03 13:00:34,271 DEBUG ConfigurationItemTypeLoader - Loaded mapping: ugcuser to storage: ugcdb
2012-06-03 13:00:34,271 DEBUG ConfigurationItemTypeLoader - Loaded mapping: ugcitemstats to storage: ugcdb
2012-06-03 13:00:34,271 DEBUG ConfigurationItemTypeLoader - Loading publication storage mappings
2012-06-03 13:00:34,271 INFO ConfigurationStepLoader - Executing configuration step: CacheLoader
2012-06-03 13:00:34,272 INFO ConfigurationStepLoader - Executing configuration step: StorageWrapperLoader
2012-06-03 13:00:34,283 DEBUG StorageManagerFactory - Default storage provider has caching set to: false
2012-06-03 13:00:34,283 DEBUG StorageManagerFactory - Loaded following dao Properties[publication=0, typeMapping=UGCItemStats, storageId=ugcdb, cached=false] for publication/typeMapping/itemExtension: 0 / UGCItemStats / null
2012-06-03 13:00:34,283 DEBUG StorageManagerFactory - Loading a non cached DAO for publicationId/typeMapping/itemExtension: 0 / UGCItemStats / null
2012-06-03 13:00:34,284 DEBUG StorageManagerFactory - Wrapping DAO's, currently 0 wrappers installed
2012-06-03 13:00:34,290 DEBUG StorageManagerFactory - Default storage provider has caching set to: false
2012-06-03 13:00:34,290 DEBUG StorageManagerFactory - Loaded following dao Properties[publication=0, typeMapping=Comment, storageId=ugcdb, cached=false] for publication/typeMapping/itemExtension: 0 / Comment / null
2012-06-03 13:00:34,290 DEBUG StorageManagerFactory - Loading a non cached DAO for publicationId/typeMapping/itemExtension: 0 / Comment / null
2012-06-03 13:00:34,290 DEBUG StorageManagerFactory - Wrapping DAO's, currently 0 wrappers installed
2012-06-03 13:00:34,291 DEBUG JPACommentDAO - Add comment to storage: Comment [commentId=0, content=This is a test comment, which will probably appear to be anonymous, itemPublicationId=19, itemId=320, itemType=16, author=com.tridion.storage.ugc.UGCUser#2598a35d, creationDate=Sun Jun 03 15:00:25 CEST 2012, lastModifiedDate=Sun Jun 03 15:00:25 CEST 2012, moderatedDate=null, moderator=null, score=0, status=0].
2012-06-03 13:00:34,295 INFO StorageManagerTransactionMonitor - Starting storage transaction monitoring
2012-06-03 13:00:34,296 DEBUG StorageManagerFactory - Default storage provider has caching set to: false
2012-06-03 13:00:34,296 DEBUG StorageManagerFactory - Loaded following dao Properties[publication=0, typeMapping=UGCUser, storageId=ugcdb, cached=false] for publication/typeMapping/itemExtension: 0 / UGCUser / null
2012-06-03 13:00:34,296 DEBUG StorageManagerFactory - Loading a non cached DAO for publicationId/typeMapping/itemExtension: 0 / UGCUser / null
2012-06-03 13:00:34,297 DEBUG StorageManagerFactory - Wrapping DAO's, currently 0 wrappers installed
2012-06-03 13:00:34,297 DEBUG JPAUserDAO - Searching for user with id null in storage.
2012-06-03 13:00:34,847 DEBUG ResolverBase - Entry: com.tridion.webservices.odata.input.ODataInputElementType#6bd8c046 was selected, checking if expanding is needed
2012-06-03 13:00:34,858 DEBUG JPAUserDAO - User already in storage. No need to create new one.
2012-06-03 13:00:34,894 DEBUG WebContext - setCurrentClaimStore: null, thread: Thread-2
2012-06-03 13:00:34,912 DEBUG WebContext - setCurrentClaimStore: null, thread: Thread-1
2012-06-03 13:00:34,967 DEBUG WebContext - setCurrentClaimStore: null, thread: Thread-6
2012-06-03 13:00:34,968 DEBUG WebContext - setCurrentClaimStore: null, thread: Thread-8
2012-06-03 13:00:34,991 DEBUG ClaimStore - put: uri=taf:response:cookie:generation, value=true
2012-06-03 13:00:34,991 DEBUG WebContext - setCurrentClaimStore: com.tridion.ambientdata.dotnet.DotNetClaimStore#46798249, thread: Thread-1
2012-06-03 13:00:34,991 DEBUG ClaimStore - put: uri=taf:request:uri, value=/odata.svc/Comments
2012-06-03 13:00:34,993 DEBUG ClaimStore - put: uri=taf:request:full_url, value=http://cdweb.visitorsweb.local/odata.svc/Comments
2012-06-03 13:00:34,993 DEBUG ClaimStore - put: uri=taf:request:headers, value={content-type=[Ljava.lang.String;#5358aac4, host=[Ljava.lang.String;#6233549b, accept=[Ljava.lang.String;#17f7be7b}
2012-06-03 13:00:34,993 DEBUG ClaimStore - put: uri=taf:request:cookies, value={ASP.NET_SessionId=e3kzwdajhvc3ickvtjavm0co}
2012-06-03 13:00:34,994 DEBUG ClaimStore - put: uri=taf:request:parameters, value={CONTENT_TYPE=[Ljava.lang.String;#9fa8988, $orderby=[Ljava.lang.String;#1f5b44d6, QUERY_STRING=[Ljava.lang.String;#21044daf, $filter=[Ljava.lang.String;#21882d18, $expand=[Ljava.lang.String;#734893da, $top=[Ljava.lang.String;#21e30857, $skip=[Ljava.lang.String;#40389922}
2012-06-03 13:00:34,994 DEBUG ClaimStore - put: uri=taf:server:variables, value={REMOTE_USER=, PATH_TRANSLATED=C:\inetpub\LiveCDService\odata.svc, SERVER_PORT=80, SCRIPT_NAME=/odata.svc, REMOTE_ADDR=127.0.0.1, AUTH_TYPE=, SERVER_PROTOCOL=HTTP/1.1, REQUEST_METHOD=GET, DOCUMENT_ROOT=C:\inetpub\LiveCDService, REMOTE_HOST=127.0.0.1, SERVER_NAME=cdweb.visitorsweb.local, SECURE=false}
2012-06-03 13:00:34,994 DEBUG ClaimStore - put: uri=taf:session:id, value=tridion_ee26e9d0-c82e-4731-8c62-2f6c324d256a
2012-06-03 13:00:34,995 DEBUG ClaimStore - put: uri=taf:tracking:id, value=tridion_435315be-7eca-4bda-94c8-acefdd03b594
2012-06-03 13:00:34,995 DEBUG ClaimStore - put: uri=taf:session:attributes, value={Tridion.ContentDelivery.AmbientData.ClaimStore=Tridion.ContentDelivery.AmbientData.ClaimStore}
2012-06-03 13:00:34,996 DEBUG AllowAnonymousPostClaimProcessor - No external user specified, using tracking id.
2012-06-03 13:00:34,996 DEBUG ClaimStore - put: uri=taf:claim:contentdelivery:webservice:user, value=tridion_435315be-7eca-4bda-94c8-acefdd03b594
2012-06-03 13:00:34,996 DEBUG ClaimStore - put: uri=taf:claim:contentdelivery:webservice:post:allowed, value=false
2012-06-03 13:00:34,997 DEBUG ODataService - ODATA.NET: Resource retrieval: Comments
2012-06-03 13:00:34,997 DEBUG WebContext - setCurrentClaimStore: com.tridion.ambientdata.dotnet.DotNetClaimStore#46798249, thread: Thread-6
2012-06-03 13:00:34,999 DEBUG ODataWebserviceHandler - Requested a OData feed/entry: Comments with type: application/json
2012-06-03 13:00:35,000 DEBUG ResolverBase - Requested OData collection
2012-06-03 13:00:35,003 DEBUG FilterValue - check if value: -1 is of Integer type
2012-06-03 13:00:35,003 DEBUG FilterValue - value: -1 is Integer
After several days working on this issue, I have just realized that the solution to this matter is that the "ugc_ambient_cartridge.xml" must be configured in the cd_ambient_conf of both the website and the visitor web service.
That's because they need to know the definition of the user claim "taf:claim:contentdelivery:webservice:user".
I frankly have no clue what you did wrong... on my system it's working as expected, I don't get any null users - instead I see something like
2012-06-01 13:30:53,811 DEBUG UserManager - UserManager.checkUser: found user: USER: Id=125; PresentationId=1; Login=
And the loaded comments show the correct text as entered when I created the comment.
I am also using the AllowAnonymousPostClaimProcessor, just noticed I have it on both the website and Odata (not sure if needed, but not going to change something that works).
Let me know if I can email you any logs and/or configuration files.
Related
Airflow: Indefinitely running HTTP Task with no response
Please help me understand on why is this http task running for long time, with no progress. I`m running the official example on HTTP but looks like missing something here. https://github.com/apache/airflow/blob/providers-http/4.1.1/tests/system/providers/http/example_http.py AIRFLOW_CTX_DAG_EMAIL=airflow#example.com AIRFLOW_CTX_DAG_OWNER=airflow AIRFLOW_CTX_DAG_ID=example_http_operator AIRFLOW_CTX_TASK_ID=http_sensor_check AIRFLOW_CTX_EXECUTION_DATE=2023-02-17T20:53:45.614721+00:00 AIRFLOW_CTX_TRY_NUMBER=1 AIRFLOW_CTX_DAG_RUN_ID=manual__2023-02-17T20:53:45.614721+00:00 [2023-02-17, 20:53:48 UTC] {__init__.py:117} DEBUG - Preparing lineage inlets and outlets [2023-02-17, 20:53:48 UTC] {__init__.py:155} DEBUG - inlets: [], outlets: [] [2023-02-17, 20:53:48 UTC] {http.py:122} INFO - Poking: [2023-02-17, 20:53:48 UTC] {base.py:73} INFO - Using connection ID 'http_default' for task execution. [2023-02-17, 20:53:48 UTC] {http.py:150} DEBUG - Sending 'GET' to url: https://jsonplaceholder.typicode.com/ [2023-02-17, 20:53:52 UTC] {taskinstance.py:769} DEBUG - Refreshing TaskInstance <TaskInstance: example_http_operator.http_sensor_check manual__2023-02-17T20:53:45.614721+00:00 [running]> from DB [2023-02-17, 20:53:52 UTC] {base_job.py:240} DEBUG - [heartbeat] [2023-02-17, 20:53:58 UTC] {taskinstance.py:769} DEBUG - Refreshing TaskInstance <TaskInstance: example_http_operator.http_sensor_check manual__2023-02-17T20:53:45.614721+00:00 [running]> from DB [2023-02-17, 20:53:58 UTC] {base_job.py:240} DEBUG - [heartbeat] [2023-02-17, 20:54:03 UTC] {taskinstance.py:769} DEBUG - Refreshing TaskInstance <TaskInstance: example_http_operator.http_sensor_check manual__2023-02-17T20:53:45.614721+00:00 [running]> from DB [2023-02-17, 20:54:03 UTC] {base_job.py:240} DEBUG - [heartbeat] [2023-02-17, 20:54:08 UTC] {taskinstance.py:769} DEBUG - Refreshing TaskInstance <TaskInstance: example_http_operator.http_sensor_check manual__2023-02-17T20:53:45.614721+00:00 [running]> from DB [2023-02-17, 20:54:08 UTC] {base_job.py:240} DEBUG - [heartbeat] [2023-02-17, 20:54:13 UTC] {taskinstance.py:769} DEBUG - Refreshing TaskInstance <TaskInstance: example_http_operator.http_sensor_check manual__2023-02-17T20:53:45.614721+00:00 [running]> from DB Surprisingly, I`m able to test this code from CLI without any issue but having trouble run this from UI. AIRFLOW_CTX_DAG_EMAIL=airflow#example.com AIRFLOW_CTX_DAG_OWNER=airflow AIRFLOW_CTX_DAG_ID=example_http_operator AIRFLOW_CTX_TASK_ID=http_sensor_check AIRFLOW_CTX_EXECUTION_DATE=2023-02-17T21:05:22.781965+00:00 AIRFLOW_CTX_TRY_NUMBER=1 AIRFLOW_CTX_DAG_RUN_ID=__airflow_temporary_run_2023-02-17T21:05:22.781968+00:00__ [2023-02-17 16:05:23,328] {__init__.py:117} DEBUG - Preparing lineage inlets and outlets [2023-02-17 16:05:23,328] {__init__.py:155} DEBUG - inlets: [], outlets: [] [2023-02-17 16:05:23,329] {http.py:122} INFO - Poking: [2023-02-17 16:05:23,332] {base.py:73} INFO - Using connection ID 'http_default' for task execution. [2023-02-17 16:05:23,332] {http.py:150} DEBUG - Sending 'GET' to url: https://jsonplaceholder.typicode.com/ [2023-02-17 16:05:23,335] {connectionpool.py:1003} DEBUG - Starting new HTTPS connection (1): jsonplaceholder.typicode.com:443 [2023-02-17 16:05:23,667] {connectionpool.py:456} DEBUG - https://jsonplaceholder.typicode.com:443 "GET / HTTP/1.1" 200 None [2023-02-17 16:05:23,669] {base.py:228} INFO - Success criteria met. Exiting. [2023-02-17 16:05:23,669] {__init__.py:75} DEBUG - Lineage called with inlets: [], outlets: [] [2023-02-17 16:05:23,670] {taskinstance.py:1329} DEBUG - Clearing next_method and next_kwargs. [2023-02-17 16:05:23,670] {taskinstance.py:1318} INFO - Marking task as SUCCESS. dag_id=example_http_operator, task_id=http_sensor_check, execution_date=20230217T210522, start_date=, end_date=20230217T210523 [2023-02-17 16:05:23,670] {taskinstance.py:2241} DEBUG - Task Duration set to None [2023-02-17 16:05:23,696] {cli_action_loggers.py:83} DEBUG - Calling callbacks: [] [2023-02-17 16:05:23,696] {settings.py:407} DEBUG - Disposing DB connection pool (PID 65429)
Cannot add a new channel to monolog for prod environment
I wanted to add a new block in my monolog config in order to have logs of a specific bundle in a separate log file. Say that the channel is called purchase config_dev.php / config_prod.php purchase: type: rotating_file max_files: 10 path: %kernel.logs_dir%/purchase_%kernel.environment%.log level: debug channels: purchase In dev mode, every thing works great and the puchase logs are written in purchase_dev.log. However, although the log configuration of prod mode is the same as dev mode, I'm getting this error Fatal error: Uncaught exception 'Symfony\Component\DependencyInjection\Exception\InvalidArgumentException' with message 'The service definition "monolog.logger.purchase" does not exist.' in /home/users/me/projects/ecoback/vendor/symfony/symfony/src/Symfony/Component/DependencyInjection/ContainerBuilder.php:798
monolog: channels: ["purchase"] handlers: purchase: type: rotating_file max_files: 10 path: %kernel.logs_dir%/purchase_%kernel.environment%.log level: debug channels: ["purchase"]
Service is already enabled, and is dead
I have the following states: copy_over_systemd_service_files: file.managed: - name: /etc/systemd/system/consul-template.service - source: salt://mesos/files/consul-template.service - owner: consul start_up_consul-template_service: service.running: - name: consul-template - enable: True - restart: True - require: - file: copy_over_systemd_service_files - watch: - /etc/systemd/system/consul-template.service when I run my state file I get the following error: ID: start_up_consul-template_service Function: service.running Name: consul-template Result: False Comment: Service consul-template is already enabled, and is dead Started: 17:27:38.346659 Duration: 2835.888 ms Changes: I'm not sure what this means. All I want to do is restart the service once it's been copied over and I've done this before without issue. Looking back through the stack trace just shows that Salt ran systemctl is-enabled consult-template
I think I was over complicating things. Instead I'm doing this: consul-template: service.running: - require: - file: copy_over_systemd_service_files - watch: - /etc/systemd/system/consul-template.service
how to instruct saltstack to reload firewalld?
I'm trying to configure firewalld via saltstack state file (on Centos7). I can add services just fine to permanent configuration, but that indeed goes into 'permanent' configuration, not in the running one. So, either a reload is needed or (less optional) add same services to running configuration too. What I've used to add the service: public: firewalld.present: - name: public - services: - http That works, but just to permanent. I've tried to add a "watch", but that won't work at all: firewalld: service.running: - watch: - file: /etc/firewalld/zones/public.xml Error is: Comment: The following requisites were not found: watch: file: /etc/firewalld/zones/public.xml So, what can be done? How can I instruct a service reload via a state file?
You were close. You can't watch a file directly on the file system. You can only watch another Salt state. So your example would look like this: public: firewalld.present: - name: public - services: - http firewalld: service.running: - watch: - firewalld: public What this means is that the service.running state will look for changes to the firewalld.present state and restart firewalld if changes did occur. If you want a reload vs a complete restart, this should work: public: firewalld.present: - name: public - services: - http firewalld: service.running: - reload: True - watch: - firewalld: public Here's docs on the service state: https://docs.saltstack.com/en/latest/ref/states/all/salt.states.service.html
Sqlite file db for codeception testing fails
Attempts to use a sqlite file database in the app/cache/tests directory fail. This is determined by clearing the dev MySQl database and populating the test environment database via the console. Test database being populated was confirmed by an external Sqlite Manager. [Tests performed without the sqlite configuration pass.] codeception.yml: actor: Tester paths: tests: tests log: tests/_output data: tests/_data support: tests/_support envs: tests/_envs settings: bootstrap: _bootstrap.php colors: false memory_limit: 1024M extensions: enabled: - Codeception\Extension\RunFailed modules: config: - Db: dsn: 'sqlite:./app/cache/test/test.sqlite' user: '' password: '' dump: tests/_data/test.sql populate: true cleanup: false reconnect: true Edit: In an Ubuntu VM, adding the Symfony2 configuration to acceptance.yml allows for partial success - the test uses the Sqlite db but does not rewrite from the specified dump (test.sql). In Windows adding the Symfony configuration makes no difference. acceptance.yml: class_name: AcceptanceTester modules: enabled: - PhpBrowser: url: http://vol - \Helper\Acceptance # adding these lines enables Ubuntu to use sqlite db - Symfony2: app_path: ./app environment: test
You haven't enabled Db module in acceptance.yml modules: enabled: - Db - PhpBrowser: url: http://vol - \Helper\Acceptance Also don't add PhpBrowser and Symfony2 at the same time, only one can be used.